class

Logarithm::VarlogLogSource

Inherits Logarithm::AbstractLogSource < Reference < Object

VarlogLogSource

Constructors

new(log_files : Array(String) = ["/var/log/syslog", "/var/log/messages"], read_existing : Bool = false)
Source

Instance methods

descriptions

Returns human-readable descriptions of this log source.

Used for logging, auditing, and user interface purposes. Should return an array of strings describing the source(s).

Returns: Array of descriptive strings (e.g., ["systemd journal", "/var/log/syslog"])

Source
start(channel : Channel(String))

Starts the log source and begins sending log lines to the channel.

This method should initiate log reading in a non-blocking manner, typically by spawning a background fiber. Log lines should be sent to the provided channel as strings.

Parameters:

  • channel: Channel to send log lines to

The channel should be closed when log reading is complete or stopped.

Source
stop

Stops the log source and cleans up resources.

This method should signal background fibers to stop and close any open file handles, network connections, or system resources. After calling stop, the source should be ready to start again.

Source