Is that a literal path?....
"...\my.ear\my.war\WEB-INF/log4j.xml"
First, it's invalid since it has 3 periods, rather than 1 or 2. Second, your
slashes are inconsistent. If you want to be agnostic to the OS, just always
use forward slashes ("/"), which will work under both Unix and Windows in
Java. Third, when using relative paths, the path is going to be relative to
the directory from which the JVM started. So, let's say this is...
${weblogic.home}/server/bin
Log4j would be looking for your file in....
${weblogic.home}/server/my.ear/my.war/WEB-INF/log4j.xml
...which is almost certainly incorrect.
Also, keep in mind that because you are not [likely] using a logger repository
selector, you will be using the default logger repository unless you are using
child-first, or parent-last, classloading. If you want per/webapp logger
configuration, this is a must. Otherwise, you might as well place log4j.xml
in the server's classpath. And if you aren't doing anything special regarding
setting runtime properties for you configuration to use, then it is rather
pointless to use a custom Log4j init servlet. Just place log4j.xml in
WEB-INF/classes and be done. Log4j will automatically pick this up and use
it.
Jake
On Thu, 26 May 2011 01:27:42 +0000
"KARR, DAVID (ATTSI)" <[email protected]> wrote:
Using log4j 1.2.16 in WebLogic 10.3.2.
While my app is starting up, I'm seeing the following message:
Log4JInitServlet is initializing log4j
Initializing log4j with: ...\my.ear\my.war\WEB-INF/log4j.xml
log4j: Could not find root logger information. Is this OK?
This is the log4j.xml file it's reading:
-----------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "http://jakarta.apache.org/log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="consoleAppender"
class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.TTCCLayout"/>
</appender>
<logger name="org.springframework" additivity="false">
<level value="warn"/>
<appender-ref ref="consoleAppender"/>
</logger>
<logger name="org.apache.cxf" additivity="false">
<level value="warn"/>
<appender-ref ref="consoleAppender"/>
</logger>
<root>
<priority value ="warn" />
<appender-ref ref="consoleAppender"/>
</root>
</log4j:configuration>
-----------------
I don't see anything wrong with this.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]