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.
In a Logback. xml file, all the configuration options are enclosed within the <configuration> root element. In the root element, you can set the debug=true attribute to inspect Logback's internal status. You can also configure auto scanning of the configuration file by setting the scan=true attribute.
You may specify the location of the default configuration file with a system property named "logback. configurationFile". The value of this property can be a URL, a resource on the class path or a path to a file external to the application.
I found the solution
-Dlogging.config="C:\logbacs\logback.xml"
is working fine for me.
Updated because the previous answer was obsolete
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With