-
Notifications
You must be signed in to change notification settings - Fork 152
-
Notifications
You must be signed in to change notification settings - Fork 152
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
File Name Not Updated When Rotating Based On Time With Zero Backup #296
Comments
When you use log_2023-05-04_16-25-00_2023-05-04_16-25-00.log This example (using master) will achieve what you are looking for #include "quill/Quill.h"
static char const* base_filename = "logfile.log";
int main()
{
// Start the backend logging thread
quill::start();
// Create a rotating file handler with a max file size per log file and maximum rotation up to 5 times
std::shared_ptr<quill::Handler> file_handler = quill::time_rotating_file_handler
(base_filename, "w", quill::FilenameAppend::None, "M", 1, 5);
// Create a logger using this handler
quill::Logger* logger_bar = quill::create_logger("rotating", std::move(file_handler));
for (uint32_t i = 0; i < 15; ++i)
{
LOG_INFO(logger_bar, "Hello from {} {}", "rotating logger", i);
std::this_thread::sleep_for(std::chrono::seconds{61});
}
}
The most reset logfile has always the name of the edit : it seems there is a bug at this and I am currently looking |
I have pushed a fix in master for this, it will be in 2.9.1 Let me know if you still have issues after this fix and thanks for reporting 👍 |
I expect the following code updates the file name when rotating based on the time but it keeps the file name the same as start time.
For example, if the logging starts at 5/4/23 16:25 the I expect the logs rotate every minute as below but that is not the case.
log_2023-05-04_16-25-00.log
log_2023-05-04_16-26-00.log
log_2023-05-04_16-27-00.log
...
Does this make sense?
The text was updated successfully, but these errors were encountered: