Usage of static serilog logger
# help-with-umbraco
b
I look over v10+ code and tried to understand usage of static logger in umbraco, I think it is legacy thing left after v8 switch to serilog and not addressed with v9+ code? I was looking to make umbraco logger more universal and to allow store logs not onluy
d
Hi there! As far as I know, static loggers are not a thing in Umbraco 10+. Serilog integrates with dotnet's built-in logger, so you can write logs by consuming
ILogger
from microsoft namespace.
Umbraco's serilog instance is not exposed (I think), but you can extend serilog through the appsettings.json
b
@D_Inventor it is a thing with umbraco, if you would check source code you would see it is created statically and put into DI later. Which means you cannot do wrapper loggers which would be great to do with Umbraco Logger to be able to switch from file to db etc 🙂
2 Views