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 Jochen Hinrichsen <jo...@kambrium.net> on 2012/10/05 15:27:56 UTC

Display line number of logfile in logfile

We are experiencing log entries being written to the wrong files using
DailyRollingFileAppender rotating on an hourly basis. In addition, file
sizes are changing between rollovers. We have massive log entries, 128
cores, and large files. The issue happens sporadic, and is not reproducible.

Now, before diving into the analysis, i wanted to log a number identifying
the log entry to make sure no entries get lost:

<timestamp> 0000000001 <log entry>
<timestamp> 0000000002 <log entry>
<timestamp> 0000000003 <log entry>

After rolling to a fresh file:

<timestamp> 0000000004 <log entry>

and so on. This line number (plus a little script) could verify that rolling
does not drop any entries.

I did not find a conversion character in PatternLayout. I do not want to use
L (Used to output the line number from where the logging request was
issued).

Any idea other than writing my own appender?

-- 
View this message in context: http://old.nabble.com/Display-line-number-of-logfile-in-logfile-tp34518214p34518214.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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