Boost :: log add_file_log does not write if the application exits with CTRL_CLOSE_EVENT

I am on Windows 7 using boost :: log in v1.54 in a console application. I use add_file_log () with rotation, which works fine while my main () function exits. But if the application exits externally using powershell CloseMainWindow (), the log file is never written.

I installed the Windows control handler using SetConsoleCtrlHandler (), and I can block CTRL_CLOSE_EVENT, but I don’t know if there is a boost :: log method that I can call to force the log file to write before my application exits. Does anyone have a solution for this?

Thanks,

  Rob
0
source share
1

, .

1) , . auto_flush, . , , CTRL_CLOSE_EVENT.

2) , , . , , . , . file_name , , . , , .

,

+1

All Articles