Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
737 stars 358 forks source link

null messages in logs #1968

Open tjrobinson opened 5 years ago

tjrobinson commented 5 years ago

I've been getting lots of log entries (using Serilog and Seq) with the message null.

image

I tracked it down to these lines:

https://github.com/Azure/azure-webjobs-sdk/blob/b798412ad74ba97cf2d85487ae8479f277bdd85c/src/Microsoft.Azure.WebJobs.Host/Loggers/Logger/LoggerExtensions.cs#L53

https://github.com/Azure/azure-webjobs-sdk/blob/b798412ad74ba97cf2d85487ae8479f277bdd85c/src/Microsoft.Azure.WebJobs.Host/Loggers/Logger/LoggerExtensions.cs#L59

Would it be possible to log a short message to go along with the data? Something along the lines of "Function completed" would be more than enough.

KamilLach commented 5 years ago

I've observed the same behaviour and noticed "null" entries are related to internal messages with TriggerReason like New queue message detected

image

Currently i am using 3.0.11 version of SDK

KamilLach commented 3 years ago

In my case i filter out those logs using Serilog exclude mechanism: "Using": [ "Serilog.Settings.Configuration" ], "Filter": [ { "Name": "ByExcluding", "Args": { "expression": "(Application is not null) and **has(State)** " } } ],