Timber v2.3.0 Timber.Config View Source

Link to this section 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

Allows for the sanitizations of custom header keys. This should be used to ensure sensitive data, such as API keys, do not get logged

Configuration for the :body byte size limit in the Timber.Events.HTTP* events. Bodies that exceed this limit will be truncated to this byte limit. The default is 2048 with a maximum allowed value of 8192

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

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

Link to this section Functions

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"

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

Example

config :timber, :event_key, :timber_event
Logger.info("test", timber_event: my_event)
Link to this function header_keys_to_sanitize() View Source

Allows for the sanitizations of custom header keys. This should be used to ensure sensitive data, such as API keys, do not get logged.

Note, the keys passed must be lowercase!

Timber normalizes headers to be downcased before comparing them here. For performance reasons it is advised that you pass lower cased keys.

Example

config :timber, :header_keys_to_sanitize, ["my-sensitive-header-name"]

Configuration for the :body byte size limit in the Timber.Events.HTTP* events. Bodies that exceed this limit will be truncated to this byte limit. The default is 2048 with a maximum allowed value of 8192.

Example

config :timber, :http_body_size_limit, 2048

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"

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

Example

config :timber, :json_encoder, fn map -> encode(map) end
Link to this function phoenix_instrumentation_level(default) View Source
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

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