bootique / bootique-logback

Provides Logback integration with Bootique
http://bootique.io
Apache License 2.0
6 stars 10 forks source link

Support appender-independent default log format #41

Closed andrus closed 6 years ago

andrus commented 6 years ago

This task will help to deal with a scenario when we need to switch appenders (such as "console" in dev mode, "file" - in prod mode), but would want to define a common log format. The idea is that the default log format can be defined at the top level of the config and inherited by all appenders (with the ability to redefine) :

log:
  logFormat: "%-5p [%d{ISO8601,UTC}] %thread %c{20}: %m%n%rEx"

Note that not all appenders support logFormat (ConsoleAppender and FileAppender do, but say SentryAppender does not). Still the concept seems to be common enough to make sense at the top level.