Re: Is there a way to log time format in miliseconds

"Carter Kozak" <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <[email protected]>
You should be able to use include the following in your pattern: %d{UNIX_MILLIS}
From the docs: https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout

Best,
-ck

On Thu, Sep 30, 2021, at 17:55, Niranjan Rao wrote:
> Greetings,
> 
> On log4j2.
> 
> I have tried obvious searches and it was immediately clear to me. I'm 
> looking for a way to get the time stamp similar to value returned by 
> System.currentTimeMillis().
> 
> Also want to ensure I can log both human readable and (more) machine 
> readable formats based on format string. We have some other log files 
> which can't use log4j and just log Sytem.currentTimeMilis as the time 
> stamp and it gets very interesting to match timestamps.
> 
> Regards,
> 
> Niranjan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.