I'm on Windows 7, using boost::log in v1.54 in a console application. I'm using add_file_log() with rotation, which works fine as long as my main() function exits. But if the app is terminated externally with powershell CloseMainWindow(), the log file never gets written.
I've set up a windows control handler using SetConsoleCtrlHandler(), and can trap CTRL_CLOSE_EVENT, but I don't know if there's a boost::log method I can call to force the log file to write prior to my app exiting. Does anyone have a solution for this?
Thanks,
Rob