Search code examples
javaeclipsests-springsourcetoolsuite

How to set my log4j.properties to my classpath


This could be a duplicate, so please bear with me.
I have a log4j.properties file in \WebContent\conf folder.
I don't know if it is set in the classpath or not.

I am using Spring Source Tool Suite for development.
Can anyone please help me set it to the classpath?


Solution

  • What is \WebContent\conf? WebContent is the "web" folder of a dynamic web project in Eclipse? Then place the config file directly there.

    If you don't put your log4j config in a root folder that is part of the classpath you can use

    -Dlog4j.configuration=name-and-path-of-config-file

    when you start the JVM.