logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: epoch time format for logging
Date Thu, 03 Oct 2013 11:07:08 GMT
YW!

Gary

On Oct 3, 2013, at 1:55, Edward Peschko <horos11@gmail.com> wrote:

> Gary,
>
> Thanks for this - it will be very, very useful for our project.
>
> Ed
>
> On Wed, Oct 2, 2013 at 7:53 AM, Gary Gregory <garydgregory@gmail.com> wrote:
>> On Tue, Oct 1, 2013 at 1:08 PM, Gary Gregory <garydgregory@gmail.com> wrote:
>>
>>> I create a JIRA to track possible solutions:
>>> https://issues.apache.org/jira/browse/LOG4J2-415
>>>
>>> I have attached two different solutions in a patch file.
>>
>> I reworked the code in the date converter solution to be more OO. This is
>> now in SVN. Use %d{UNIX} and %d{UNIX_MILLIS}. I updated the manual in SVN
>> as well.
>>
>> Gary
>>
>>
>>>
>>> Gary
>>>
>>>
>>> On Mon, Sep 30, 2013 at 11:33 PM, Gary Gregory <garydgregory@gmail.com>wrote:
>>>
>>>> Hello Ed,
>>>>
>>>> This is what Log4j 2 can do now WRT to time stamp formatting:
>>>> https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout
>>>>
>>>> When you say epoch time, do you mean simply that you would like to use
>>>> the result of java.lang.System.currentTimeMillis() ?
>>>>
>>>> Gary
>>>>
>>>>
>>>> On Mon, Sep 30, 2013 at 8:30 PM, Edward Peschko <horos11@gmail.com>wrote:
>>>>
>>>>> All,
>>>>>
>>>>> For reasons of simplicity && consistency, I would like to have
my logs
>>>>> have epoch time (plus milliseconds) as their format. I figure:
>>>>>
>>>>> 1. this should be the most efficient way to get a timestamp
>>>>> 2. it is completely clear - unlike local time, or partial times (eg.
>>>>> HH:MM:SS) there is no question of exactly when the event occurred.
>>>>> 3. it is concise - only taking 10 (or 14 with ms timestamp) characters.
>>>>> 4. it is exceedingly easy to do date arithmetic with it
>>>>> 5. it can searched as a number hence finding ranges in which events
>>>>> occured in very large files is a simple, binary search.
>>>>>
>>>>> Anyways, looking through the docs for log4j, I didn't see any docs on
>>>>> how to do this. Is it possible, and if not currently possible, how
>>>>> easy would it be to add it?
>>>>>
>>>>> Again, I'd like to standardize all my logs on this, so any info on how
>>>>> to do it is appreciated..
>>>>>
>>>>> Thanks much,
>>>>>
>>>>> Ed
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>>
>>>
>>> --
>>> 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
>>
>>
>>
>> --
>> 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
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message