LoggerLogentriesBackend
About
A backend for the Elixir Logger that will send logs to the Logentries TCP input.
Supported options
- host: String.t. The hostname of the logentries endpoint. [default:
data.logentries.com] - port: Integer. The port number for logentries. [default:
80] - token: String.t. The unique logentries token for the log destination.
- format: String.t. The logging format of the message. [default:
[$level] $message\n]. - level: Atom. Minimum level for this backend. [default:
:debug] - metdata: Keyword.t. Extra fields to be added when sending the logs. These will be merged with the metadata sent in every log message.
Using it with Mix
To use it in your Mix projects, first add it as a dependency:
def deps do
[{:logger_logentries_backend, github: "sysdia-solutions/logger_logentries_backend"}]
endThen run mix deps.get to install it.
Configuration Examples
Runtime
Logger.add_backend {Logger.Backend.Logentries, :debug}
Logger.configure {Logger.Backend.Logentries, :debug},
host: 'data.logentries.com',
port: 10000,
token: "logentries-token-goes-here",
level: :debug,
format: "[$level] $message\n"Application config
config :logger,
backends: [{Logger.Backend.Logentries, :error_log}, :console]
config :logger, :error_log,
host: 'data.logentries.com',
port: 10000,
token: "logentries-token-goes-here",
level: :error,
format: "[$level] $message\n"