Name: logger_journald_backend
Owner: xerions
Description: null
Created: 2015-08-21 16:49:02.0
Updated: 2018-05-15 13:19:06.0
Pushed: 2015-08-22 06:48:03.0
Homepage: null
Size: 136
Language: Elixir
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a backend for elixir Logger
.
It will send logs out of lager to systemd journald.
the Logger.Backend.Journald
is a custom backend for the elixir :logger
application. To configure
lager_journald_backend
just add Logger.Backend.Journald
the to your configuration like this:
ig :logger,
ckends: [Logger.Backend.Journald]
Without any other configuration, the Logger.Backend.Journald
will use info
as default log level
and "[$level] $message\n"
as format for the log messages.
To provide own configuration add backends' configuration to configuration file:
ig :logger,
ckends: [Logger.Backend.Journald]
ig :logger, :logger_journald_backend,
vel: :debug,
rmat: "[$level] $message\n",
tadata: [:city]
and use it as:
er.error "TestLogMessage_Error", [city: "Berlin"]
And then simply check your journal for the corresponding message with the:
urnalctl | sed '$!d'
20 17:55:37 localhost beam.smp[24082]: [error] TestLogMessage_Error
Logger
provides two functions: add_backend/2
and configure_backend/2
to add backend and configure backend in runtime.
Usage:
er.add_backend(Logger.Backend.Journald, [])
er.configure(Logger.Backend.Journald, [level: :error, format: "$time $message"])
logger_journald_backend
uses ejournald.