Timber v3.0.0-alpha.2 Timber.Events.ErrorEvent View Source
The ErrorEvent
is used to track errors and exceptions.
The defined structure of this data can be found in the log event JSON schema: https://github.com/timberio/log-event-json-schema
Timber automatically tracks and structures errors and exceptions in your application. Giving you detailed stack traces, context, and error data.
Link to this section Summary
Functions
Adds a stacktrace to an event, converting it if necessary
Builds a new error event from an error / exception
Builds an error from the given log message. This allows us to create Error events downstream in the logging flow. Because of the complicated nature around Elixir exception handling, this is a reliable catch-all to ensure all error are capture and processed properly
Message to be used when logging
Convenience methods for building error events, taking care to normalize values and ensure they meet the validation requirements of the Timber API
Link to this section Types
backtrace_entry() :: %{ app_name: String.t() | nil, function: String.t(), file: String.t() | nil, line: non_neg_integer() | nil }
stacktrace_entry() :: {module(), atom(), arity(), [file: IO.chardata(), line: non_neg_integer()] | []}
t() :: %Timber.Events.ErrorEvent{ backtrace: [backtrace_entry()] | nil, message: String.t() | nil, metadata_json: binary() | nil, name: String.t(), type: String.t() | nil }
Link to this section Functions
add_backtrace(t(), [stacktrace_entry()] | [backtrace_entry()]) :: t()
Adds a stacktrace to an event, converting it if necessary
Builds a new error event from an error / exception.
Builds an error from the given log message. This allows us to create Error events downstream in the logging flow. Because of the complicated nature around Elixir exception handling, this is a reliable catch-all to ensure all error are capture and processed properly.
Message to be used when logging.
Convenience methods for building error events, taking care to normalize values and ensure they meet the validation requirements of the Timber API.