From: Jens Wille Date: 2008-07-17T18:26:19+09:00 Subject: Re: Logging 0.9.0 (the "Monkeyful Chimptacular" release) hi! Shin guey Wong [2008-07-17 08:58]: > require 'logging' > > logger = Logging::Logger['example_logger'] > logger.add_appenders( > Logging::Appender.stdout, > Logging::Appenders::File.new('example.log') > ) > logger.level = :info > > logger.debug "this debug message will not be output by the logger" > logger.info "just some friendly advice" > > Base on the sample above, how do I configure different log level for 2 > output. Eg I want the stdout to be :info level bug the logfile to be > :debug level. Is this possible? you can set the log level on the appender individually: logger = Logging::Logger['example_logger'] logger.add_appenders( Logging::Appenders::Stdout.new(nil, :level => :info), Logging::Appenders::File.new('example.log') ) logger.level = :debug but note that you can only set *higher* thresholds on the appenders, events below the log level of the superordinate logger instance won't be passed through to the appenders, AFAIK. tim, please correct me if i'm wrong ;-) cheers jens -- Jens Wille, Dipl.-Bibl. (FH) prometheus - Das verteilte digitale Bildarchiv f端r Forschung & Lehre Kunsthistorisches Institut der Universit辰t zu K旦ln Albertus-Magnus-Platz, D-50923 K旦ln Tel.: +49 (0)221 470-6668, E-Mail: jens.wille@uni-koeln.de http://www.prometheus-bildarchiv.de/