Can I disable an appender in logback on the xml config? I have my configuration and I want to put two appenders, one for database and other for text logs, but only one must be activated. thanks!
Not sure why you want to deactivate an appender, what are you trying to achieve by disabling.
There are some ways to achieve it
<configuration>
<appender name="stdoutappender" />
<appender name="dbappender" />
<logger name="stdoutlogger" level="DEBUG">
<appender-ref ref="stdoutappender" />
</logger>
<logger name="dblogger" level="OFF">
<appender-ref ref="dbappender" />
</logger>
</configuration>
In this case also you have to reload the configuration when you modify logback configuration (logback.xml)
On top of above 3 options you can create logback configurations progamatically