0

My need is quite simple:

with log4cplus, I'd like to be able to write a log in a log file and to flush the log file everytime before I write in it. This way, while I run my application, I will only have one single line in my log file.

I've tryed the append=False property, but it only flush the log file at startup.

I could do it by hand in C++ but I don't want to write C++ code as the product is already in prod.

Any idea ?

Thanks,

Julien Greard
  • 969
  • 1
  • 12
  • 32

1 Answers1

0

Use the ImmediateFlush property to force the file appender to flush after each event.

wilx
  • 17,697
  • 6
  • 59
  • 114
  • I tryed it, it doesn't work. As @deviantfan said, it looks like it's about flushing buffered data and not about clearing the log file – Julien Greard Aug 25 '15 at 14:24
  • Oh. I misunderstood what you wanted. I think a logging library might not be what you want. – wilx Aug 25 '15 at 14:34