How can we load logback.xml via jvm argument if this is not present in project classpath?
I'm using
-Dlogback.configuration=file:C:\logbacs\logback.xml
but this is not working.
How can we load logback.xml via jvm argument if this is not present in project classpath?
I'm using
-Dlogback.configuration=file:C:\logbacs\logback.xml
but this is not working.
If you're not using SpringBoot the above won't work.
I'm using the ch.qos.logback.logback-classic library, and in this case the solution is
I've found this property in ch.qos.logback.classic.util.ContextInitializer:
The original answer to this question doesn't appear to be working anymore as it produces this warning instead:
Therefore, you would want to use something like this:
I found the solution
is working fine for me.
Updated because the previous answer was obsolete