Question

I'm develpoing a java application that uses slf4j logging with log4j framework. Is there any way to configure appenders programatically with slf4j?

Was it helpful?

Solution

First, I would strongly go against programmatically configuring SLF4J/Log4J in normal application because it is rarely appropriate to do so, and it is making SLF4J meaningless.

If you insist to do so, then you should understand, SLF4J is simply a wrapper for underlying logging library. SLF4J itself do not have any configuration. What you need to do is "programmatic configuration of the underlying logging framework". If you choose to use Log4J, then search for related information for Log4J. If you choose to use JUL, then search for JUL, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top