howto configure logging via yaml

H

Holger K.

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
 
H

Holger K.

Okay, meanwhile I got it:

Here an example for other seekers :)

# 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top