Timber v2.0.0-rc1 Timber.Config

Summary

Functions

Your Timber application API key. This can be obtained after you create your application in https://app.timber.io

Helpful to inspect internal Timber activity; a useful debugging utility. If specified, Timber will write messages to this device. We cannot use the standard Logger directly because it would create an infinite loop

Change the name of the Logger metadata key that Timber uses for events. By default, this is :event

Configuration for the :body size limit in the Timber.Events.HTTP* events. Bodies that exceed this limit will be truncated to this limit

Custom HTTP client to use for transmitting logs over HTTP. Timber comes packaged with a :hackney client. See Timber.Transports.HTTP.HackneyClient. If you do not want to use :hackney you can easily write your own client to handle log transport

Alternate URL for delivering logs. This is helpful if you want to use a proxy, for example

Specify a different JSON encoder function. Timber uses Poison by default

Specify the log level that phoenix log lines write to. Such as template renders

Retrieves the preflight URL

Gets the transport specificed in the :timber configuration. The default is Timber.Transports.IODevice

Functions

api_key()

Your Timber application API key. This can be obtained after you create your application in https://app.timber.io

Example

config :timber, :api_key, "abcd1234"
debug_io_device()

Helpful to inspect internal Timber activity; a useful debugging utility. If specified, Timber will write messages to this device. We cannot use the standard Logger directly because it would create an infinite loop.

event_key()

Change the name of the Logger metadata key that Timber uses for events. By default, this is :event

Example

config :timber, :event_key, :timber_event
Logger.info("test", timber_event: my_event)
http_body_size_limit()

Configuration for the :body size limit in the Timber.Events.HTTP* events. Bodies that exceed this limit will be truncated to this limit.

Please take care with this value, increasing it too high can mean very large payloads and very high outgoing network activity.

Example

config :timber, :http_body_size_limit, 5000
http_client()

Custom HTTP client to use for transmitting logs over HTTP. Timber comes packaged with a :hackney client. See Timber.Transports.HTTP.HackneyClient. If you do not want to use :hackney you can easily write your own client to handle log transport.

Example

config :timber, :http_client, MyCustomHTTPClient
http_url()

Alternate URL for delivering logs. This is helpful if you want to use a proxy, for example.

Example

config :timber, :http_url, "https://123.123.123.123"
json_encoder()

Specify a different JSON encoder function. Timber uses Poison by default.

Example

config :timber, :json_encoder, fn map -> encode(map) end
phoenix_instrumentation_level(default)
phoenix_instrumentation_level(atom) :: atom

Specify the log level that phoenix log lines write to. Such as template renders.

Example

config :timber, :instrumentation_level, :info
preflight_url()

Retrieves the preflight URL

transport()

Gets the transport specificed in the :timber configuration. The default is Timber.Transports.IODevice.