Search code examples
log4j

Do I need to update log4j.properties file if I use the Log4j 1.x bridge (log4j-1.2-api)


I've followed the doc here : https://logging.apache.org/log4j/2.x/manual/migration.html Also looked at https://logging.apache.org/log4j/2.x/manual/configuration.html#Properties

My existing log4j.properties only uses DailyRollingFileAppender, ConsoleAppender, both of which are under the 'Supported Components', so I shouldn't be forced to convert my log4j.properties file into log4j2.properties format. I'm not accessing methods and classes internal to the Log4j 1.x implementation, as suggested by the document.

For using the bridge, I previously was using both log4j1.compatibility and log4j.configuration, but the document suggests using 'any one' (tried using just one, doesn't work)

I can build my application successfully, however, my application no longer logs anything. What am I missing?


Solution

  • Figured it out. The answer lied in the Automatic Configuration section