1

1)be.file backend has a feature - messages added before _be_file_set_filename() are not lost and will be appended to log later. 2)_be_file_set_filename opens file immediately => if no entries was added, emty file will be created

Question: how to suppress creating empty file (create file only when first log entry appended) and save feature 1) ?

2 Answers2

0

Use the flag PANTHEIOS_BE_FILE_F_DELETE_IF_EMPTY, described here.

My guess is that the file is created synchronously to avoid the less-desirable situation where a log file cannot be created while a process is running. If you really want that, maybe add the functionality and supply back to the project?

dcw
  • 3,481
  • 2
  • 22
  • 30
  • That's a solution but `Note: The current implementation checks the actual file size, as opposed to **"remembering"** whether any writes were made (by Pantheios).` – Baron_Muenchhausen Nov 01 '11 at 03:23
0

I've solved this problem by writing custom backend - wrapper over be.file