View Source NLdoc.Logging.Logger (NLdoc.Logging v1.0.1)
The Logger module provides a simple logging interface for the NLdoc applications. It basically just aliases Logger, but also adds some metadata to each log message.
Additionally, it supports the following metadata keys:
error
: An exception that occurred in the application. This will be forwarded toLogger
ascrash_reason
along with a stack trace of where the log method was called from.
Configuration
Configure in config/config.exs
the following:
# ...
config :logger, :default_handler,
formatter: {LoggerJSON.Formatters.Elastic, metadata: {:all_except, [:application]}}
config :logger, :console,
metadata: [
:error,
:labels,
:"url.path",
:"event.action",
# ...
:"service.name",
:"service.version",
:"service.environment",
# ...
:"trace.id"
# ... etc, to your own needs.
]
# ...
Summary
Functions
Returns the stacktrace of the calling function.
Types
Functions
@spec flush() :: :ok
@spec get_stacktrace() :: stacktrace()
Returns the stacktrace of the calling function.