Search code examples
javaloggingweb-applicationslogback

Logback configuration via jvm argument


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.


Solution

  • I found the solution

    -Dlogging.config="C:\logbacs\logback.xml"
    

    is working fine for me.

    Updated because the previous answer was obsolete