Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
log4cxxが新しいログファイルを作成するたびに、ログファイルの先頭に(最初のメッセージとして)特別な文字列を書き込むようにしたいと思います。
どうすれば強制できますか?
ありがとう!
からレイアウトを作成しlog4cxx::PatternLayout、再実装できます。appendHeader()この関数は、ファイルが作成されたときにlog4cxx::FileAppender::setFile()( を介して) から呼び出されます。log4cxx::WriterAppender::writeHeader()
log4cxx::PatternLayout
appendHeader()
log4cxx::FileAppender::setFile()
log4cxx::WriterAppender::writeHeader()