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 oops <oo...@telcoware.com> on 2005/08/29 15:26:11 UTC
FW: Log4J date/time output problem
Hello.
I also have the below problem.
I don't use ASYNC file appender
I just use DailyRollingFIleAppender.
My log4j.properties is below..
======================================================================
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.File=/home1/useraccount/log/TMCSWEB/tmcsweb.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{HH:mm:ss} [%5p] (%F:%L) [%M] - %m%n
======================================================================
When I test the application , everything is ok.
but when somebody do the performance test
I had the same problem
this is web application.
When multiful threads access the same function,
the timestamp is not ordered by time.
( one thread write the log as time sequence. but I has plenty many threads. and the timestamp is not ordered )
Can I have the log ordered by time ?
===========================================
텔코웨어㈜
135-933 서울 강남구 역삼동 823-21 대공빌딩13층
텔코웨어 기술부문 연구3그룹 응용5팀
대리 신욱수
TEL:02-2105-0021
FAX: 02-2105-9899
=============================================
-----Original Message-----
From: Ceki G?c [mailto:ceki@qos.ch]
Sent: Wednesday, January 12, 2005 12:09 AM
To: Log4J Users List
Subject: Re: Log4J date/time output problem
Yoval,
One possible explanation is the order in which AsyncAppender wakes up one of threads waiting to push events on AsyncAppender's buffer, when this buffer is full.
http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()
public final void notify()
Wakes up a single thread that is waiting on this object's monitor. If
any threads are waiting on this object, one of them is chosen to be
awakened. The choice is ARBITRARY and occurs at the discretion of the
implementation. A thread waits on an object's monitor by calling one
of the wait methods.
Assuming logs are generated at a fast face, the AsyncAppender's buffer will become full fairly quickly and frequently.
If you would like me to investigate this further, then could you please provide a sample of the logs? I am only interested in the timestamps, the logger names and the thread names. A few dozen logs surrounding the unorderly behavior should suffice.
At 03:32 PM 1/11/2005, you wrote:
>Hello,
>I'm using Log4J 1.2.6 with the following
>configuration:
>AsyncAppender writing to
>RollingFileAppender which is using PatternLayout with conversion
>pattern "%p | %d{ISO8601} | %t | %x | %c | %m%n".
>My platform is JDK 1.4.2 on Linux redhat 9.0 .
>
>Lately, when I loaded my system to check performence,
>I noticed that some lines in the log file have
>incosistent time values:
>Sometimes, one line had a timestamp smaller then the
>line before it.
>I also noticed that the Thread source name for these
>lines is always different (so, in the context of one
>thread, there is no problem).
>
>What can be the source of this behavior?
>
>Thanks,
>Yuval
--
Ceki Gülcü
The complete log4j manual: http://www.qos.ch/log4j/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org