Closed stiggy87 closed 1 year ago
Yes, there is a way. Call rollLogFiles
from RollingFileAppender
at the beginning:
plog::RollingFileAppender<plog::TxtFormatter> fileAppender("file.log", 1000000, 1);
fileAppender.rollLogFiles();
Thus you'll have one log file written from the start every time a program is launched.
Great! This works perfectly for what I want, even if I set the maxFiles to another value.
Thanks!
I'm using PLOG as a way to track user interactions in my application, so it's separate from the main log. What I would like is that if the program is closed/re-opened that the second log is rolled at start. Is there a way to do that, or would it be a custom FileAppender?