Howto configure logging via yaml

Hi there,

I am new to both ruby an yaml and i am unsuccessfully trying to setup a
logging configuration. (using logging-1.2.3)

As there is neither an example nor a specification of the
“logging_config” structure I have to guess from the source. But I cannot
make hands or tails out of it (appenders expects an array(Appender) of
arrays(name+config?!? - should name be an option?)). Can someone post an
(nontrivial) example or elaborate on the structure?

Regards,
Holger

Okay, meanwhile I got it:

Here an example for other seekers :slight_smile:

set global logging to “info”

add another level called remark

create a logger named “main” logging warnings

log everything to stderr like this

“hh:mm:ss LEVEL main: messsage”

logging_config:
pre_config:
define_levels: [ debug, info, remark, warn, error, fatal ]
appenders:

  • name: app1
    type: Stderr
    layout:
    type: Pattern
    pattern: “%d %-7l %4c: %m\n”
    date_pattern: %H:%M:%S
    loggers:
  • name: root
    level: info
    appenders:
    • app1
  • name: main
    level: warn

Regards,
Holger