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. Gary On Mon, Sep 30, 2013 at 11:33 PM, Gary Gregory <[email protected]>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 <[email protected]> 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: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > -- > E-Mail: [email protected] | [email protected] > 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: [email protected] | [email protected] 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
