class SemanticLogger::Appender::Udp
def initialize(server:, udp_flags: 0, metrics: true, **args, &block)
server: 'server:3300'
appender: :udp,
SemanticLogger.add_appender(
Example:
that the message has to traverse. See https://en.wikipedia.org/wiki/Maximum_transmission_unit
* UDP packet size is limited by the connected network and any routers etc
Limitations:
Default: true
Send metrics only events over udp.
metrics: [Boolean]
The Proc must return true or false.
Proc: Only include log messages where the supplied Proc returns true
regular expression. All other messages will be ignored.
RegExp: Only include log messages where the class name matches the supplied.
filter: [Regexp|Proc]
Default: Use the built-in formatter (See: #call)
the output from this appender
An instance of a class that implements #call, or a Proc to be used to format
formatter: [Object|Proc]
Default: SemanticLogger.default_level
Override the log level for this appender.
level: [:trace | :debug | :info | :warn | :error | :fatal]
Default: SemanticLogger.host
Name of this host to appear in log messages.
host: [String]
Default: SemanticLogger.application
Name of this application to appear in log messages.
application: [String]
Common Appender Parameters:
Default: 0
Should be a bitwise OR of Socket::MSG_* constants.
udp_flags: [Integer]
URL of the server to write UDP messages to.
server: [String]
Create UDP log appender.
def initialize(server:, udp_flags: 0, metrics: true, **args, &block) @server = server @udp_flags = udp_flags super(metrics: metrics, **args, &block) reopen end