class
Analogger::Client
- Analogger::Client
- Reference
- Object
Overview
Swift::Analogger::Client is the client library for writing logging messages to the Swift Analogger asynchronous logging server.
To use the Analogger client, instantiate an instance of the Client class.
logger = Swift::Analogger::Client.new(:myapplog,'127.0.0.1',12345)
Four arguments are accepted when a new Client is created. The first is the name of the logging facility that this Client will write to. The second is the hostname where the Analogger process is running, and the third is the port number that it is listening on for connections.
The fourth argument is optional. Analogger can require an authentication key before it will allow logging clients to use its facilities. If the Analogger that one is connecting to requires an authentication key, it must be passed to the new() call as the fourth argument. If the key is incorrect, the connection will be closed.
If a Client connects to the Analogger using a facility that is undefined in the Analogger, the log messages will still be accepted, but they will be dumped to the default logging destination.
Once connected, the Client is ready to deliver messages to the Analogger. To send a messagine, the log() method is used:
logger.log(:debug,"The logging client is now connected.")
The log() method takes two arguments. The first is the severity of the message, and the second is the message itself. The default Analogger severity levels are the same as in the standard Ruby
Defined in:
analogger/client.cranalogger/client/version.cr
Constant Summary
-
CONNECTION_FAILURE_TIMEOUT =
86400 * 2
-
MAX_FAILURE_COUNT =
0_u128 &- 1
-
MAX_LENGTH_BYTES =
MAX_MESSAGE_LENGTH.to_s.length
-
MAX_MESSAGE_LENGTH =
8192
-
PERSISTENT_QUEUE_LIMIT =
10737412742_i64
-
RECONNECT_THROTTLE_INTERVAL =
0.1
-
VERSION =
"0.1.0"
Constructors
Class Method Summary
- .connection_failure_timeout
- .connection_failure_timeout=(val)
- .max_failure_count
- .max_failure_count=(val)
- .persistent_queue_limit
- .persistent_queue_limit=(val)
- .reconnect_throttle_interval
- .reconnect_throttle_interval=(val)
Instance Method Summary
- #_drain_the_swamp
- #_local_log(service, severity, message)
- #_remote_log(service, severity, message, flush_after_send = true)
- #authenticate
- #authenticated? : Bool
- #clear_failure
- #close
- #close_connection
- #closed?
- #connect
- #connection_failure_timeout : Int32
- #connection_failure_timeout=(val)
- #drain_the_swamp
- #fail_connect?
- #failed?
- #failed_too_long?
- #failed_too_many?
- #log(severity, msg)
- #max_failure_count : UInt128
- #max_failure_count=(val)
- #non_blocking_lock_on_file_handle(file_handle, &)
- #open_connection(host, port)
- #persistent_queue_limit : Int64
- #persistent_queue_limit=(val)
- #ram_queue_limit
- #ram_queue_limit=(val)
-
#read
Read a message from the wire using a length header before the msgpack payload.
- #reconnect
- #reconnect_throttle_interval
- #reconnect_throttle_interval=(val)
- #register_failure
- #setup_local_logging
- #setup_reconnect_fiber
- #setup_remote_logging
- #there_is_a_swamp?
- #tmplog
- #tmplog=(tmplog : Nil | String)
- #tmplog_prefix
- #tmplogs
- #total_count : Int32