How to force log4cxx to write certain string on top of the log file?

324 Views Asked by At

I want that everytime when log4cxx creates new log file it would write special string on top (as the first message) of the log file.

How can I force it to do so ?

Thank You!

1

There are 1 best solutions below

1
On

You can create your layout from log4cxx::PatternLayout and reimplement appendHeader(), this function is called from log4cxx::FileAppender::setFile() (through log4cxx::WriterAppender::writeHeader())when file created.