Timber v0.1.2 Timber.Transports.IODevice

The IODevice transport mechanism allows you to log directly to stdout (default; see below) or any other IODevice of your choice

Default Output

The suggestion above is that the default configuration of this transport will log to stdout by default. This is true in most cases, but it is misleadingly generic. The output will actually be sent to the process registered under the name :user. This process is registered by the VM at startup and is designed to handle IO redirection. In other words, :user is the middleman that will typically write to stdout unless you have additional configuration that would make it redirect output elsewhere.

Synchronicity

The IODevice transport will output messages asynchronously to the IO device using standard BEAM process messaging. After sending output to be written, the transport will begin buffering all new log events. When the remote IO device responds that the output was successful, the buffer will be flushed to the IO device, repeating the process. If the buffer reaches its maximum size, the transport will switch to simulated synchronous mode, blocking until the IO device sends a response about the last write operation.

Transport Configuration Options

The following options are available when configuring the IODevice logger:

max_buffer_size

The maximum number of log entries that the log event buffer will hold until the transport switchs to synchronous mode. This value should be tuned to accomodate your system’s IO capability versus the amount of logging you perform.

Defaults to 100.

print_timestamps

When true (default), the timestamp for the log will be output at the front of the statement.

When false, the timestamp will be suppressed. This is only useful in situations where the log will be written to an evented IO service that automatically adds timestamps for incoming data, like Heroku Logplex.