1

I've been struggling for weeks to upgrade Log4j from 1.x to 2.x. By far the biggest difficulty is converting the configuration, which the Log4j authors changed completely between versions without fully documenting how to migrate.

For example, my application currently uses Log4j 1.x with a log4j.properties file that starts with the following line:

log4j.rootCategory=WARN, CONSOLE

In order to convert this to Log4j 2.x configuration syntax, I have to first understand its meaning within the context of Log4j 1.x configuration syntax. This does not appear to be possible.

The Log4j 2.x Configuration Guide does not contain a reference to log4j.rootCategory or any other information that helps me understand its meaning.

The Log4j Migration Guide from 1.x to 2.x does not contain a reference to log4j.rootCategory or any other information that helps me understand its meaning.

I've searched for Log4j 1.x configuration documentation for two days now, and I've found nothing useful. I performed web searches for "log4j convert syntax", "log4j 1.x config documentation", "log4j.rootCategory documentation", "log4j rootCategory configuration" and more. None of these returned anything other than the above links or other pages that do not contain a reference to log4j.rootCategory or any other information that helps me understand its meaning.

This Stack Overflow question question states that "The actual Documentation for the LOG4J version 1.x is offline." This appears to be largely true, although @Tobias Otto provides a link to the Log4j 1.x manual at logging.apache.org/log4j/1.2/manual.html. This page does have a perfunctory "Configuration" section, but it does not contain a reference to log4j.rootCategory or any other information that helps me understand its meaning.

I'm out of ideas. What does setting log4j.rootCategory accomplish in the context of Log4j 1.x configuration syntax? How is this goal accomplished in the context of Log4j 2.x configuration syntax? Is there any meaningful documenation available for Log4j 1.x configuration directives?

Borea Deitz
  • 379
  • 4
  • 11

0 Answers0