You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serilog output file is being removed by Docker bind mount and never gets recreated until time comes of RollingInterval.
Description
I am adding Serilog logging in an existing .NET Core server application.
Serilog output file is being removed by Docker compose up command(docker-compose up -d) when I add logs folder volume bind mount. Removal of file is expected because the mount host folder is empty and Docker syncs both folders and makes changes to the folder contents. After that file removal the log file never gets created until the next time comes of RollingInterval.DAY i.e. 24 hours later.
During the first 24 hours since deployment, server app logs are lost because Serilog is not recreating the removed log file. Even though the methods in the source code are being called i.e Log.Information("Some logging message");
Expected behavior
When my docker container is started, the logs folder should not be empty after Log.Information("Some logging message") method is called.
OR when the file is deleted by the Docker volume sync process, then Serilog should recreate output file whenever Log.Information("Some logging message"); is called.
Relevant package, tooling and runtime versions
What Serilog version are you using, on what platform?
"Serilog" Version="4.0.0"
"Serilog.AspNetCore" Version="8.0.1"
"Serilog.Formatting.Compact" Version="3.0.0"
"Serilog.Sinks.Http" Version="9.0.0"
Serilog output file is being removed by Docker bind mount and never gets recreated until time comes of RollingInterval.
Description
I am adding Serilog logging in an existing .NET Core server application.
Serilog output file is being removed by Docker compose up command(docker-compose up -d) when I add logs folder volume bind mount. Removal of file is expected because the mount host folder is empty and Docker syncs both folders and makes changes to the folder contents. After that file removal the log file never gets created until the next time comes of RollingInterval.DAY i.e. 24 hours later.
During the first 24 hours since deployment, server app logs are lost because Serilog is not recreating the removed log file. Even though the methods in the source code are being called i.e Log.Information("Some logging message");
Reproduction Configurations
"Docker" Version="4.29.0"
"Docker Compose" Version="v2.26.1-desktop.1"
".NET Core" Version="8.0"
"Serilog" Version="4.0.0"
"Serilog.AspNetCore" Version="8.0.1"
"Serilog.Formatting.Compact" Version="3.0.0"
"Serilog.Sinks.Http" Version="9.0.0"
Expected behavior
When my docker container is started, the logs folder should not be empty after Log.Information("Some logging message") method is called.
OR when the file is deleted by the Docker volume sync process, then Serilog should recreate output file whenever Log.Information("Some logging message"); is called.
Relevant package, tooling and runtime versions
What Serilog version are you using, on what platform?
"Serilog" Version="4.0.0"
"Serilog.AspNetCore" Version="8.0.1"
"Serilog.Formatting.Compact" Version="3.0.0"
"Serilog.Sinks.Http" Version="9.0.0"
"Docker" Version="4.29.0"
"Docker Compose" Version="v2.26.1-desktop.1"
".NET Core" Version="8.0"
App container was deployed Windows and also on Linux. Got this problem on both deployments.
Additional info
If there is anything I am doing wrong then please guide/correct my implementation.
The text was updated successfully, but these errors were encountered: