Timber v1.0.2 API Reference

Modules

The functions in this module work by modifying the Logger metadata store which is unique to every BEAM process. This is convenient in many ways. First and foremost, it does not require you to manually manage the metadata. Second, because we conform to the standard Logger principles, you can utilize Timber alongside other Logger backends without issue. Timber prefixes its contextual metadata keys so as not to interfere with other systems

The ContextEntry module formalizes the structure of context stack entries

A custom context can be specified by the user that is specific to the system being logged

The HTTP context tracks information about an HTTP request currently being handled

The organization context tracks the organization of the currently authenticated user

Tracks process information

The Server context tracks information about the host your system runs on

A common interface for working with data structures that implement the Timber.Event behaviour

The ControllerCallEvent represents a controller being called during the HTTP request cycle

The CustomEvent represents events that aren’t covered elsewhere

The ExceptionEvent is used to track exceptions

The HTTPClientRequestEvent tracks outgoing HTTP requests giving you structured insight into communication with external services

The HTTPClientResponseEvent tracks responses for outgoing HTTP requests. This gives you structured insight into communication with external services

The HTTPServerRequestEvent tracks incoming HTTP requests. This gives you structured insight into the HTTP requests coming into your app

The HTTPServerResponseEvent tracks responses for incoming HTTP requests. In other words, the resposnes you are sending back to your clients. This gives you structured insight into the response you are sending back to your clients

The SQLQueryEvent tracks outgoing SQL queries. This gives you structured insight into SQL query performance within your application

The TemplateRenderEvent trackes template rendering within your app. Giving you structured insight into template rendering performance

Automatically captures the HTTP request ID in Plug-based frameworks like Phoenix and adds it to the context

Timber integration for Ecto

Handles error reports from the :error_logger application

Automatically logs metadata information about HTTP requests and responses in Plug-based frameworks like Phoenix

The LogEntry module formalizes the structure of every log entry

The LoggerBackend module is at the heart of Timber’s integration. It specifies a backend that can be used with the standard Logger application distributed with Elixir

A Transport specifies the way in which Timber.LoggerBackend should actually output log events

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

Utility functions for Timber

Exceptions

Error raised when the device being sought is non-existent or otherwise cannot be found or used

Protocols

Converts a data structure into a Timber.Event.t. This is called on any data structure passed in the :event metadata key passed to Logger