serilog-sinks-http
serilog-sinks-http copied to clipboard
Bufferfile is not processed after deployment.
We are using the time rolled buffers on a application hosted in an azure appservice. The BufferRollingInterval is set to "HOUR" After the deployment of a new version we do not receive logs until the next rollover.
I have notice the following:
- Bufferfile before deployment: "Bufferfile-2022102614.txt"
- The deployment triggers the creation of a new file: "Bufferfile-2022102614_001.txt"
This file is never picked up by the LogShipper, seams like it is ignored. The bookmarkfile keeps pointing to the "Bufferfile-2022102614.txt" file. This automatically gets resolved when the next file is created "Bufferfile-2022102615.txt" The ignored files are also not automatically removed.
Using v8.0.0 Any idea on how to fix this?
Hi there and welcome to this repository!
A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.
Hi @Roeland54 and thank you for reporting the issue. The behaviour here is indeed erroneous, but not because the log events from Bufferfile-2022102614_001.txt
aren't sent but because the file is even created in the first place. From Durable time rolled HTTP sink we read:
The maximum size of a buffer file is defined by
bufferFileSizeLimitBytes
, and when that limit is reached all new log events will be dropped until a new interval is started.
Can you show me your sink configuration?
This is my configuration. I do not define "bufferFileSizeLimitBytes". The file size is also very small when this happens.
Log.Logger = new LoggerConfiguration()
.WriteTo.DurableHttpUsingTimeRolledBuffers(
requestUri: "https://logstash.domain.com:1125",
bufferBaseFileName: "Bufferfile",
bufferRollingInterval: Serilog.Sinks.Http.BufferRollingInterval.Hour,
httpClient: new BasicAuthenticatedHttpClient(configuration.GetSection("Serilog:Settings:AuthenticationSettings").Get<AuthenticationSettings>()),
configuration: configuration)
.CreateLogger();
Thanks! I'll look into this, hopefully starting next week.
I have set "bufferFileShared" to "true". The issue seams to be resolved now. The File sink is automatically creating these _001 postfix files when the file is locked/ in use.