grc-iit / ChronoLog

ChronoLog: A High-Performance Storage Infrastructure for Activity and Log Workloads
https://chronolog.dev
BSD 2-Clause "Simplified" License
5 stars 4 forks source link

Issue with rotating file sink logger #140

Closed ibrodkin closed 2 months ago

ibrodkin commented 3 months ago

I'm running ChronoVisor & ChronoKeeper executables built of develop branch (tag 2024.02.28) and I see and issue with both chronovisor_Server and chrono_keeper logging to a file . Both use the recentle added spdlog file rotating logger

It appears that in both cases the new logger creates the logfile.txt at initialization time but the file remains empty until the executable is shutdown. In case SIGTERM is used to kill the process, that both chronovisor and chronokeeper have signal handler for, the graceful shutdown is triggered, and the expected log messages do appear in the logfile.txt at this point. In case the same executable is killed using SIGKILL, no messages show up in the logfile at all.

It appears that the logger with file rotating sink keeps the messages in some kind of internal buffer that is only flushed at the time the logger is released/dismantled.

logger with console sink does not have this issue

ibrodkin commented 2 months ago

merged