romsky
romsky

Reputation: 884

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

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!

Upvotes: 0

Views: 336

Answers (1)

ronhartleyone
ronhartleyone

Reputation: 73

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.

Upvotes: 3

Related Questions