datalust/serilog-sinks-seq

Logs is transferred only from one app instance.

Closed this issue · 2 comments

appv commented

Hi!

I try to use latest Serilog.Sinks.Seq nuget and I found strange behavior.
I run two instances of test console application (classic .Net Framework 4.5.2) and try to log data.
File system have new four files:

  1. log-20171010.log (contains data from both app instances)
  2. seq-buffer.bookmark
  3. seq-buffer-20171001.json (log file of first app instance)
  4. seq-buffer-20171001_001.json (log file of second app instance).

The seq-buffer.bookmark has reference only to one log file (seq-buffer-20171001.json).
The log data is transfered only from the first app instance to Seq, data from second app instance is transferred after closing of first app instance.

Looks like a bug!

AppConfig settings:
serilog:minimum-level =Info
serilog:write-to:Seq.bufferBaseFilename = seq-buffer
serilog:write-to:Seq.shared =true
...
serilog:write-to:RollingFile.pathFormat =log-{Date}.log
serilog:write-to:RollingFile.retainedFileCountLimit =1000
serilog:write-to:RollingFile.fileSizeLimitBytes
serilog:write-to:RollingFile.shared" value = true

Hi @appv - thanks for the report.

The "durable" logging mode doesn't support more than one process using the buffer file at a time, hence the behavior you see here.

I'd recommend using the non-durable mode if it is an option for you, or else setting up https://github.com/datalust/seq-forwarder on the machine otherwise.

Hope this helps, let me know if you need any more info.

appv commented

nblumhardt, thanks for the clarification!