Hello,

this is another user opinion.

This particular case can probably be handled
by using StatusPrinter.print((LoggerContext)LoggerFactory.getILoggerFactory())
immediately after you explicitly initialize Logback via JoranConfigurer.

A lot of examples on this page http://logback.qos.ch/manual/joran.html have 
this code.

However I've seen a much more worring behavior.
One of the main Logback appenders apparently fails mid-day.
However we don't know it has failed.

One solution would be to run a background thread and periodically
query StatusManager for new errors. However I'd probably prefer to
have an error listerner that I can attach to LoggerContext
so that we would know our main appender has failed.

(In our case this main appender does NOT log to stdout;
we'd very much prefer to emit the error message TO stdout in this case;
we can do that in our own code no problem as long as a listener interface is 
provided).

Or the error listener could also be configurable via the config file
in a declarative fashion.

Just a bunch of ideas..

With best regards,
Anton Tagunov

>I have the following problem with log configuration. If the specified log
>file can't be created for some reason, logback fails silently (i.e. nothing
>in system.err/out). If I add debug="true" to <configuration> in logback.xml,
>I get the error logged but I also get info and debug printed. Is there any
>way to get just the errors?
>
>This is just my uninformed opinion, but I would be in favor of logging WARN
>and ERROR to system.err by default, and having an option to turn it off.
>
>Many thanks.
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user

Reply via email to