Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0, 2.0.1
-
None
Description
To summarize a recent twitter conversation:
a user became very frustrated that Log4j2 did not log to the configured file, and gave up and moved on to JUL instead.
After some questions it turned out that (probably) the problem was that they had log4j-api but not log4j-core in the classpath.
We can dismiss this saying that users should read the documentation better, but users are in a hurry to get things done and I can easily see this happening to more people.
In the above conversation, the user pointed out that very likely, if someone ends up with the default configuration (log ERROR level messages to the console), they made a mistake.
The feature request is that log4j should help users by printing a message to the console that explains why the user ended up with the default configuration.
- In case log4j-core not in the classpath: Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
- In case no config file was found: No log4j2 configuration file found. Using default configuration: errors to the console.
This last case is actually a frequent cause of questions on StackOverflow.
Attachments
Issue Links
- is related to
-
LOG4J2-729 Emit warning message to console if no config file found
- Closed