logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Sicker (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-594) LOG4G Configuration file is not loading At time of App server start when log4j not in classpath
Date Sat, 05 Apr 2014 18:23:14 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961194#comment-13961194
] 

Matt Sicker commented on LOG4J2-594:
------------------------------------

Could you try doing this:

{code}
System.setProperty("log4j.configurationFile", "file:/path/to/log4j2.xml");
Logger logger = LogManager.getLogger();
LogManager.getContext(false);
Logger other = LogManager.getLogger();
{code}

And see if the two loggers match the expected configuration. You could also try {{System.getProperty("log4j.configurationFile")}}
to see if the system property is even propagating through.

> LOG4G Configuration file is not loading At time of App server start when log4j not in
classpath
> -----------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-594
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-594
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.0-rc1
>         Environment: IBM Webshpere 8.5 app server
> Netbeans
>            Reporter: M Faisal
>            Assignee: Matt Sicker
>
> I have noticed strange behavior and i tried to fix but i could not.  There are 3 scenarios
and log is not working for 1st scenario.
> 1.  When we restart our application server then log4j configuration file is not loaded
where as log4j2.xml is not in class path but we have set the system property "log4j.configurationFile"
correctly.
> 2.  if i copy the log4j2.xml file in class path and restart our application server then
log4j configuration file is loaded and logs are being written.
> 3.  If i don't restart the application server and only restart the app (WAR) then configuration
file is loaded and logs is being written where as log4j not in class path but we have set
the system property "log4j.configurationFile" correctly.
> Our requirement is that not to put log4j2.xml in class path so we can easily modify it
and set the "log4j.configurationFile" when app start. If log is working for scenario 3 then
it should work for 1 as only difference is we are not restarting the application server in
scenario 3. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message