Closed jansoren closed 6 years ago
Logging in Azure function apps needs to be explicitly enabled in Platform Features > Diagnostic Logs. Alternatively, you could add another Serilog sink, e.g. file, blob, etc
@vludax - explicitly enabling the log level did not seem to help.
I've done some digging around this issue. Logs in Azure functions don't show up because ExtensionConfigContext.Trace
is a host-level writer, which is different from the TraceWriter
instance that can be received as a parameter to functions. Please see https://github.com/Azure/azure-webjobs-sdk-script/issues/820
In Platform Features > Log Streaming you should still see the missing logs, because that outputs both functions and host logs.
This suggests there is currently no good alternative to creating a Serilog.ILogger
in each function when they receive their own TraceWriter
s. If you do come up with something, please let us know :)
@vludax Thanks for clarifying answer
I am trying out Serilog for my Azure function app and came across this sink. It logs beutifully when running my function locally. When I publish my function-app it does not log anything at all... ?
Any suggestions?
This is my setup using dependency injection:
Host.json