class

Analogger::Client

Inherits Reference < Object

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

Constants

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

new(service : String = "default", host : String = "127.0.0.1", port : Int32 = 6766, key : String = "")
Source

Class methods

connection_failure_timeout
Source
connection_failure_timeout=(val)
Source
max_failure_count
Source
max_failure_count=(val)
Source
persistent_queue_limit
Source
persistent_queue_limit=(val)
Source
reconnect_throttle_interval
Source
reconnect_throttle_interval=(val)
Source

Instance methods

_drain_the_swamp
Source
_local_log(service, severity, message)
Source
_remote_log(service, severity, message, flush_after_send = true)
Source
authenticate
Source
authenticated?
Source
clear_failure
Source
close
Source
close_connection
Source
closed?
Source
connect
Source
connection_failure_timeout
Source
connection_failure_timeout=(val)
Source
drain_the_swamp
Source
fail_connect?
Source
failed?
Source
failed_too_long?
Source
failed_too_many?
Source
log(severity, msg)
Source
max_failure_count
Source
max_failure_count=(val)
Source
non_blocking_lock_on_file_handle(file_handle, &)
Source
open_connection(host, port)
Source
persistent_queue_limit
Source
persistent_queue_limit=(val)
Source
ram_queue_limit
Source
ram_queue_limit=(val)
Source
read

Read a message from the wire using a length header before the msgpack payload.

Source
reconnect
Source
reconnect_throttle_interval
Source
reconnect_throttle_interval=(val)
Source
register_failure
Source
setup_local_logging
Source
setup_reconnect_fiber
Source
setup_remote_logging
Source
there_is_a_swamp?
Source
tmplog
Source
tmplog=(tmplog : Nil | String)
Source
tmplog_prefix
Source
tmplogs
Source
total_count
Source

Nested types