You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by oops <oo...@telcoware.com> on 2005/08/30 11:00:13 UTC

Question about org.apache.log4j.Category Class

Hello.
 
I ask about    " forcedLog(String fqcn, Priority level, Object message,
Throwable t) "
 
I'm curious about the timing of getting systemtime for log
 
I saw the source and there exists
======================================================================
  protected
  void forcedLog(String fqcn, Priority level, Object message, Throwable t) {
    callAppenders(new LoggingEvent(fqcn, this, level, message, t));
  }
======================================================================
LoggingEvent has 
=====================================================================
timeStamp = System.currentTimeMillis();
=====================================================================
and callAppenders has synchronized block.
 
 
I think the System.currentTimeMillis() is outside of  synchronized block,
am I right?
 
I have time order problem and I think the problem is in there.
Getting time method exist outside of synchronized block. 
and this make the log data be in bad order.
my log data is like below.
21:00:00  some log
21:00:01 some log2
21:00:02 some log3
21:00:01 inordered log
21:00:03 some log4
 
Why the getting timestamp method be outside of synchronized block?
 
 
 

===========================================

텔코웨어㈜

135-933 서울 강남구 역삼동 823-21 대공빌딩13층

 

텔코웨어 기술부문 연구3그룹 응용5팀

대리 신욱수

 

TEL:02-2105-0021

FAX: 02-2105-9899

=============================================