-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't append file using text_file_backend #69
Comments
Appending will only work when the generated file name matches an existing file. This means that file names with timestamps will not work well with appending. |
even if it's in the same time? In the example, if I open the application twice in the same minute, two file logs ( Or you mean that if using time (any, even if it's just the year) the append is ignored? |
It's the file names what matters. In your example, the timestamps do match, but the counter value doesn't. The counter value doesn't match because you call |
but if I remove the |
oooh, okay... I have to remove the file collector. So it's impossible to append and collect at the same time, is that it? |
Yes, given that the file name is generated only once, there's no practical way to ensure appending happens while file collecting is enabled. Either appending won't happen (because of differing file names) or there will be name clashes when the file is collected. I'm working on a solution, though, so hopefully this problem will be resolved. |
Okay, thanks! Maybe a disclaimer here would be nice. :) I don't know if/how I can upload a documentation ""fix"", otherwise I would add |
If you're interested, you can try if e823f88 helps. With it, you can modify your initialization code like this:
|
Nice, I'll check it out asap. Thanks! |
Hi! I was trying to use the boost log to write into a file and append to it when the application restarts (and not to create a new rotating file) with a basic
text_file_backend
like the following, but it seems that it doesnt work - which means that nothing changes whenboostlog_keywords::open_mode = std::ios_base::app
is added.The full code is here.
The text was updated successfully, but these errors were encountered: