StarRezDevTeam / Serilog.Sinks.AzureWebJobsTraceWriter

Serilog Azure WebJobs/Functions TraceWriter Sink
MIT License
19 stars 4 forks source link

Additional empty log for each log entry #3

Closed dracan closed 7 years ago

dracan commented 7 years ago

I've not had chance to download the source and debug this yet to find out why, but I'm seeing an extra empty log being added for each log I write ...

image

This is running Azure Functions locally, and I'm trying to use this Sink to wrap the TraceWriter instance that Azure Functions injects into my function.

In the screenshot above the two Information logs are the only logs I'm currently writing via this Serilog sink, and they both have additional empty lines after them.

As I say, I'm happy to debug this (but probably won't have chance today). I just thought I'd put it here in case it was a known issue.

Here's my init code ...

Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Debug()
    .WriteTo.TraceWriter(traceWriter)
    .CreateLogger();

And here's the line that logs that entry ...

Log.Information("SAMPID: {Id}", sample.Id);

(note that I'm actually calling that last line twice in the screenshot above, as I wanted to double-check that the additional blank line was definitely from that log entry).

ScottHolden commented 7 years ago

Hi @dracan, I'll have a bit of a peek into it. Haven't seen this locally but I'll try to replicate it :)

dracan commented 7 years ago

Hi @ScottHolden,

Strange, I've just come back to this, and it's no longer doing it! Since I got it last time, the only related thing that has changed in my Azure Functions code is that I've fixed up a few dependency warnings. I don't have time to go back and experiment, but either way, it's no longer happening! So will close this issue.

Thanks, Dan