spdlog
spdlog copied to clipboard
Custom filename creation for all sinks
Currently, I think only the daily logger allows customizing the filename format. I'm trying to replace our internal logging framework by Spdlog, and I need to encode the date in the filename (but without using a daily logger, which is too coarse grained). Instead, I want to generate a new filename every time a size-based sink "rotates". I might be able to provide a PR if there's interest for solving this issue.
Thanks. That would be useful.
Do we have an example of how to achieve this?
How is the progress on this issue?
I need this feature as well - specifically using "datetime" instead of "index" suffix for rotated files - similar to that provided by logrotate dateformat with second resolution.
Is there any progress on this issue or a suggested workaround to achieve this?
https://github.com/gabime/spdlog/pull/1847 Does this PR solve this problem?
IIUC daily sink only rotates daily. I need file size based rotation.
I also need this feature. Is there any general schedule regarding this topic?
I would need this feature as well for size based rotation
Any updates to the issues?:
- allow file syncs to customize file names (e.g. add process name, add timestamp, etc.) - although it was stated that the daily file sink can do this I see no example of this via config file. the daily file sink appends the year/month/day to the file name automatically ... it is not customizable from a config file from what we can tell?! what are we missing? how is this done through config file?
- rotate file based on filesize - is this working? how is this done through config file?
- create new log on process crash - how is this done through config file? Thanks!