Skip to content
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

[Serilog] Properly rotate log files #667

Closed
Mart124 opened this issue Mar 14, 2020 · 2 comments
Closed

[Serilog] Properly rotate log files #667

Mart124 opened this issue Mar 14, 2020 · 2 comments
Labels

Comments

@Mart124
Copy link
Contributor

Mart124 commented Mar 14, 2020

Hi,

I open this ticket to keep in mind tracking the following issue :
#604 (comment)

To sum-up, using globalSettings__logRollBySizeLimit=1073741824, filename is OK, log.txt.

But it is "wrongly" rotated.
log.txt goes up to the limit, then new log lines go into log_001.txt.
We would rather expect moving log.txt to log_001.txt, and logging again into log.txt.

Seems like an issue with Serilog itself : serilog/serilog-sinks-file#40

Thx 👍

@Mart124
Copy link
Contributor Author

Mart124 commented Oct 20, 2020

A possible workaround is to let globalSettings__logRollBySizeLimit= empty, so that we're back with the daily-rotated log file (but still without a fixed name, see upstream issue above).

And to create a fixed log.txt by ourselves :

# create the new daily log file
docker restart bitwarden-identity
# link the fixed name
ln -f /path/to/bwdata/logs/identity/Identity/$(date +%Y%m%d).txt /path/to/bwdata/logs/identity/Identity/log.txt

Can be easily scheduled (using cron for example) everyday at 00:00 👍

@bitwarden-bot
Copy link

Hi @Mart124,
We're cleaning up our repositories in preparation for a major reorganization. Issues from last year will be marked as stale and closed after two weeks. If you still need help, comment to let us know and we'll look into it.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants