[ 
https://issues.apache.org/jira/browse/LOG4J2-1812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma updated LOG4J2-1812:
--------------------------------
    Attachment: 
LOG4J2_1801_Add_more_detail_to_WARN__Ignoring_log_event__messages_printed_to_the_console_a.patch

I tried dumping the ring buffer but it seems the ring buffer only contains 
ERROR level events... See attached patch.

Testing with this code (and no log4j2 configuration file):
{code}
public class ConfigurationFactoryTest {
    public static void main(String[] args) {
        StatusLogger.getLogger().error("Message 1");
        StatusLogger.getLogger().warn("Message 2");
        StatusLogger.getLogger().info("Message 3");
        StatusLogger.getLogger().debug("Message 4");
        LogManager.getLogger().error("Expect missing configuration error 
message...");
    }
}
{code}

Gives this error message:
{noformat}
ERROR StatusLogger Message 1
ERROR StatusLogger No log4j2 configuration file found. Using default 
configuration: logging only errors to the console. Set system property 
'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show all 
Log4j2 internal initialization logging.
The previous 1 status messages are:
2017-06-24 22:24:28,347 main ERROR Message 1
22:24:30.656 [main] ERROR 
org.apache.logging.log4j.core.config.ConfigurationFactoryTest - Expect missing 
configuration error message...
{noformat}

No time now to investigate further...

> Improve error message when log4j 2 configuration file not found
> ---------------------------------------------------------------
>
>                 Key: LOG4J2-1812
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1812
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Configurators
>    Affects Versions: 2.3, 2.4, 2.5, 2.6, 2.7, 2.8
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>         Attachments: 
> LOG4J2_1801_Add_more_detail_to_WARN__Ignoring_log_event__messages_printed_to_the_console_a.patch
>
>
> When configuration fails because no Log4j 2 configuration file is found, the 
> following message is logged to the console at ERROR level: 
> {code}
> No log4j2 configuration file found. Using default configuration: logging only 
> errors to the console.
> {code}
> We should be able to improve this. One idea is to add this:
> {code}
> No log4j2 configuration file found. Using default configuration: logging only 
> errors to the console. Set system property 
> 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show 
> Log4j2 internal initialization logging.
> {code}
> Another idea is to dump the contents of the StatusLogger ring buffer to the 
> console.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to