You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by John McNally <jm...@collab.net> on 2003/01/17 20:06:49 UTC

all log entries being copied to catalina_out.log

I have a webapp that uses log4j to direct logs to several files. Within
the tomcat installation used for development the logs go where
expected.  However in the tomcat installation to be used for production
each log entry goes to the expected file and an additional entry is
written to catalina_out.log.

One clue is that the pattern used to write the two versions of a log
entry are different.  All the log appenders are configured with the
pattern 

%d [%t] %-5p %c - %m%n

This leads to a log entries in services.log like


2003-01-17 09:24:25,351 [main] INFO  org.apache.fulcrum.TurbineServices
- Added Mapping for Service: FactoryService
2003-01-17 09:24:25,356 [main] INFO  org.apache.fulcrum.TurbineServices
- Added Mapping for Service: PoolService
2003-01-17 09:24:25,357 [main] INFO  org.apache.fulcrum.TurbineServices
- Added Mapping for Service: MimeTypeService
2003-01-17 09:24:25,357 [main] INFO  org.apache.fulcrum.TurbineServices
- Added Mapping for Service: SchedulerService
2003-01-17 09:24:25,357 [main] INFO  org.apache.fulcrum.TurbineServices
- Added Mapping for Service: UploadService


The corresponding entries in catalina_out.log are

0    [main] INFO  org.apache.fulcrum.TurbineServices  - Added Mapping
for Service: FactoryService
5    [main] INFO  org.apache.fulcrum.TurbineServices  - Added Mapping
for Service: PoolService
6    [main] INFO  org.apache.fulcrum.TurbineServices  - Added Mapping
for Service: MimeTypeService
6    [main] INFO  org.apache.fulcrum.TurbineServices  - Added Mapping
for Service: SchedulerService
6    [main] INFO  org.apache.fulcrum.TurbineServices  - Added Mapping
for Service: UploadService

where the data and time are replaced by a millisecond counter that
starts from the first log entry.

There are so many places to look trying to track this down involving
tomcat and commons-logging, so I don't quite know exactly what to ask of
this list.  I don't think there are any competing configurations, so I
don't think a different appender with an alternate pattern that is doing
the catalina_out.log entries.  Is there some configuration in log4j that
would lead to duplicating every log entry for every appender to standard
out with the time pattern shown above?

john mcnally



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: all log entries being copied to catalina_out.log

Posted by Ceki Gülcü <ce...@qos.ch>.
Here is the story.

The commons-logging API, when it decides that you want to use log4j,
takes the liberty of configuring a ConsoleAppender (on System.Err) and
attaching it to the root logger. The PattenLayout uses the pattern "%r
[%t] %p %c{2} %x - %m%n". See the code of
o.a.c.l.impl.Log4JCategoryLog.java for more details.

Since tomcat redirects System.out to catalina.out, we observe what we
observe... Mystery solved.

At 20:16 17.01.2003 +0100, you wrote:
>At 11:06 17.01.2003 -0800, you wrote:
>
>>There are so many places to look trying to track this down involving
>>tomcat and commons-logging, so I don't quite know exactly what to ask of
>>this list.  I don't think there are any competing configurations, so I
>>don't think a different appender with an alternate pattern that is doing
>>the catalina_out.log entries.  Is there some configuration in log4j that
>>would lead to duplicating every log entry for every appender to standard
>>out with the time pattern shown above?
>
>I am personally facing the same problem with struts1.1b2+tomcat4.1.12.
>Tomcat-user@ list is probably the place place to ask this question.
>
>>john mcnally
>
>--
>Ceki

--
Ceki



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: all log entries being copied to catalina_out.log

Posted by Ceki Gülcü <ce...@qos.ch>.
At 11:06 17.01.2003 -0800, you wrote:

>There are so many places to look trying to track this down involving
>tomcat and commons-logging, so I don't quite know exactly what to ask of
>this list.  I don't think there are any competing configurations, so I
>don't think a different appender with an alternate pattern that is doing
>the catalina_out.log entries.  Is there some configuration in log4j that
>would lead to duplicating every log entry for every appender to standard
>out with the time pattern shown above?

I am personally facing the same problem with struts1.1b2+tomcat4.1.12.
Tomcat-user@ list is probably the place place to ask this question.

>john mcnally

--
Ceki



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>