-
-
Save solars/c080319c0ed92125d60b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yml = <<-EOF | |
log4r_config: | |
pre_config: | |
root: | |
level: 'DEBUG' | |
loggers: | |
- name: "mylogger" | |
outputters: | |
#- gelf | |
#- stdout | |
outputters: | |
- type: StdoutOutputter | |
name: stdout | |
- type: GelfOutputter | |
name: gelf | |
gelf_server: "graylog2.seekda.com" | |
gelf_port: "12201" | |
facility: "rspec" | |
host: "local" | |
#max_chunk_size: 'WAN' | |
#level: FATAL | |
#level_mapping: logger | |
- type: EmailOutputter | |
name: email | |
tls: 'true' | |
domain: gmail.com | |
server: smtp.gmail.com | |
port: '587' | |
subject: 'Message from testing:' | |
from: ch.xx@gmail.com | |
to: christoph.xxx@xx.com | |
acct: ch.xxx@gmail.com | |
passwd: xxx | |
authtype: plain | |
formatfirst: 'true' | |
formatter: | |
date_pattern: '%y%m%d %H:%M:%S' | |
pattern: '%d %l: %m' | |
type: PatternFormatter | |
EOF | |
cfg = Log4r::YamlConfigurator | |
cfg.load_yaml_string(yml) | |
Log4r::Logger['mylogger'].error("testing") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment