From 43b3f9e96e84898a40f6605cb42afa630511d440 Mon Sep 17 00:00:00 2001 From: Michael Loftis Date: Wed, 6 Feb 2019 17:34:09 +0000 Subject: [PATCH 1/2] rids the duplicate timestamp from default ExSyslogger config --- config/config.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.exs b/config/config.exs index 8b42a5351..c272ef34a 100644 --- a/config/config.exs +++ b/config/config.exs @@ -115,7 +115,7 @@ config :logger, :console, config :logger, :ex_syslogger, level: :debug, ident: "Pleroma", - format: "$date $time $metadata[$level] $message", + format: "$metadata[$level] $message", metadata: [:request_id] config :mime, :types, %{ From ab80c8ebb85271e9b5456c36316b7ebc98d96f1e Mon Sep 17 00:00:00 2001 From: Michael Loftis Date: Wed, 6 Feb 2019 17:54:30 +0000 Subject: [PATCH 2/2] adds a couple of explicit examples for ExSyslogger --- docs/config.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/config.md b/docs/config.md index e042d216f..ba6807760 100644 --- a/docs/config.md +++ b/docs/config.md @@ -100,6 +100,26 @@ config :pleroma, Pleroma.Mailer, ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog + +An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed: +``` +config :logger, + backends: [{ExSyslogger, :ex_syslogger}] + +config :logger, :ex_syslogger, + level: :warn +``` + +Another example, keeping console output and adding the pid to syslog output: +``` +config :logger, + backends: [:console, {ExSyslogger, :ex_syslogger}] + +config :logger, :ex_syslogger, + level: :warn, + option: [:pid, :ndelay] +``` + See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_syslogger’s documentation](https://hexdocs.pm/ex_syslogger/)