[
https://issues.apache.org/jira/browse/LOG4J2-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13745906#comment-13745906
]
wei wang commented on LOG4J2-365:
---------------------------------
Hi Remko,
I have print out the "classpath" and "java.class.path ", they are not the same!
However,I have the log4j2.xml built in the same path as the child.classes in
the child.jar, but still could not detect the log4j2.xml
---------------------------------------------------------------------------------------
...
379 Tue Aug 20 10:15:08 CEST 2013 com/ericsson/rbs/clitool/session/Session.class
941 Tue Aug 20 10:15:08 CEST 2013
com/ericsson/rbs/clitool/session/SessionFactory.class
5956 Tue Aug 20 10:15:08 CEST 2013
com/ericsson/rbs/clitool/session/SessionImpl.class
1196 Tue Aug 20 10:15:08 CEST 2013 log4j2.xml
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<here
27 Tue Aug 20 10:15:08 CEST 2013 oamCliClient.properties
--------------------------------------------------------------------------------------------------
what makes it work is to edit in the child class source code with:
static
{ System.setProperty(XMLConfigurationFactory.CONFIGURATION_FILE_PROPERTY,
System.getProperty("user.home")+ File.Separator +"log4j2.xml"); }
conclusion: If log4j2.xml packed in a jar file, it will not work! It must be
specified at cmd -Dlog4j..... or to make a setting in the source code as above.
question: How to embed the external lib log4jxxx.jar in my child.jar so that
logging would still work ? Any best practice there?
> ERROR StatusLogger Unable to locate a logging implementation, using
> SimpleLogge
> -------------------------------------------------------------------------------
>
> Key: LOG4J2-365
> URL: https://issues.apache.org/jira/browse/LOG4J2-365
> Project: Log4j 2
> Issue Type: Question
> Components: log4j 1.2 emulation
> Affects Versions: 2.0-beta7
> Environment: windows7
> Reporter: wei wang
> Priority: Blocker
> Labels: ERROR, SimpleLogge, StatusLogger, Unable, a,
> implementation,, locate, logging, to, using
> Fix For: 2.0-beta7
>
> Original Estimate: 12h
> Remaining Estimate: 12h
>
> I have problem to make the logging work with the log4j2.xml when packing
> into jar file.
> I have launcher.jar which calls oamcli.jar(has logging implementation and log
> is working in eclipse)
> How ever when I try to run :
> java -Dlog4j.configurationFile=path\to\log4j2.xml -cp "launcher.jar; lib\*"
> .....
> I got a "ERROR StatusLogger Unable to locate a logging implementation, using
> SimpleLogger"
> Please give me some advice and where to look for the answer.
> Thanks!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]