1

When Log4cxx decides to write the logs it caches into the file (as configured previously), is it buffer based or timer based?

Also, can I configure Log4cxx to write the logs when I send the logs to it not when it decides to ?

Sherif
  • 1,249
  • 4
  • 15
  • 38

1 Answers1

1

When you set your file in the RollingfileAppender with setfile() you can tell whether you want buffered IO or not. This option will automatically configure setImmediateFlush() accordingly.

The code for the buffered writter shows that the flushing decistion is taken based on the size exclusively (if the buffer+new output exceeds bufer size).

Christophe
  • 68,716
  • 7
  • 72
  • 138