Hello Thorsten Schöning,
thank you for your quick answer.
On 12/01/2016 05:34 PM, Thorsten Schöning wrote:
Guten Tag Felix Endres,
am Donnerstag, 1. Dezember 2016 um 16:37 schrieben Sie:
is it possible to print a unix timestamp, i.e. seconds since 1970 in the
PatternLayout (or any other layou
In the man page you linked to I found
*%s *The number of seconds since the Epoch, 1970-01-01 00:00:00
+ (UTC). (TZ) (Calculated from/mktime(tm)/.)
There is nothing under a second, so I combine it with %d{SSS}:
log4j.appender.R.layout.ConversionPattern=[%p] [%d{%s}.%d{SSS}]: %m%
If I'm understanding the code correctly, in your %d{} specifier, you can
define a custom format using apr_strftime(). I'm assuming that this means
you can use the standard strftime() specifiers, but the documentation for
APR is somewhat lacking.
http://man7.org/linux/man-pages/man3/strftime.3.htm
Guten Tag Felix Endres,
am Donnerstag, 1. Dezember 2016 um 16:37 schrieben Sie:
> is it possible to print a unix timestamp, i.e. seconds since 1970 in the
> PatternLayout (or any other layout)? Optimally I would like a fractional
> pattern showing microseconds.
Is your question about the format o
Hi,
is it possible to print a unix timestamp, i.e. seconds since 1970 in the
PatternLayout (or any other layout)? Optimally I would like a fractional
pattern showing microseconds.
Apparently log4j 2 has a "%d{UNIX}" pattern, but this just prints "UNIX"
in log4cxx. I am using the ubuntu liblog