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 Fabio <an...@gmail.com> on 2015/01/26 09:44:42 UTC

Timestamp reliability (log4j in Hadoop)

Hi everyone,
I am using Hadoop, that uses log4j as logging system.
Since I don't know anything about how log4j works, and since I am 
relying on the logs for my work, I would like to ask you how reliable is 
the timestamp I see in the logs.
Is each timestamp I see the exact real system time at which each 
"LOG.info(...)" function is called within the Hadoop code? Or is the log 
request enqueued in some buffer so that the timestamp includes some 
delay to process the entries in this buffer?
I asked this in the Hadoop mailing list but with no answer, hope to have 
more luck here.

Thanks in advance

Fabio

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Timestamp reliability (log4j in Hadoop)

Posted by Fabio <an...@gmail.com>.
Thanks Gary, indeed I forced a timestamp into the string passed to the 
log and, comparing it with the log timestamp itself, the difference is 
within 1 ms.

Regards

Fabio

On 01/26/2015 01:44 PM, Gary Gregory wrote:
> On Mon, Jan 26, 2015 at 3:44 AM, Fabio <an...@gmail.com> wrote:
>
>> Hi everyone,
>> I am using Hadoop, that uses log4j as logging system.
>> Since I don't know anything about how log4j works, and since I am relying
>> on the logs for my work, I would like to ask you how reliable is the
>> timestamp I see in the logs.
>> Is each timestamp I see the exact real system time at which each
>> "LOG.info(...)" function is called within the Hadoop code?
>
> Yes. The info() call creates a log event object which includes a timestamp.
> Exactly when the log event is used and how is up to each appender
> implementation.
>
> Gary
>
>
>> Or is the log request enqueued in some buffer so that the timestamp
>> includes some delay to process the entries in this buffer?
>> I asked this in the Hadoop mailing list but with no answer, hope to have
>> more luck here.
>>
>> Thanks in advance
>>
>> Fabio
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Timestamp reliability (log4j in Hadoop)

Posted by Gary Gregory <ga...@gmail.com>.
On Mon, Jan 26, 2015 at 3:44 AM, Fabio <an...@gmail.com> wrote:

> Hi everyone,
> I am using Hadoop, that uses log4j as logging system.
> Since I don't know anything about how log4j works, and since I am relying
> on the logs for my work, I would like to ask you how reliable is the
> timestamp I see in the logs.
> Is each timestamp I see the exact real system time at which each
> "LOG.info(...)" function is called within the Hadoop code?


Yes. The info() call creates a log event object which includes a timestamp.
Exactly when the log event is used and how is up to each appender
implementation.

Gary


> Or is the log request enqueued in some buffer so that the timestamp
> includes some delay to process the entries in this buffer?
> I asked this in the Hadoop mailing list but with no answer, hope to have
> more luck here.
>
> Thanks in advance
>
> Fabio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory