I have an umbraco installation with Serilog MinimumLevel Information.
I want remove all the "ImageSharp" logs with the @MessageTemplate "Sending image. Request uri: '{Uri}'. Cached Key: '{Key}'"
How can i do it?
You can acheive this by changing the Serilog log level in the appsettings.json. The log you're talking about is set to severity Information so you need to be at Warning or higher to not show it.
You can either change the Default in the MinimumLevel which will change for all your loggers, or you can specify it in the Override property, as shown below:
I tend to agree - all that noise isn't really "information", more "debug". If we didn't have the power to deactivate I would probably have raised an issue.
For anyone still annoyed by the noisyness of the ImageSharp cluttering up the Information log, I had it completely removed by this Serilog configuration:
That’ll definitely do it, but might make debugging a bit hard if something does go wrong. Setting the level to Fatal or Error may work to remove all the clutter.
How to disable Sending image log
I have an umbraco installation with Serilog MinimumLevel Information. I want remove all the "ImageSharp" logs with the @MessageTemplate "Sending image. Request uri: '{Uri}'. Cached Key: '{Key}'" How can i do it?
Thanks a lot
Damiano
You can acheive this by changing the Serilog log level in the
appsettings.json
. The log you're talking about is set to severityInformation
so you need to be atWarning
or higher to not show it.You can either change the
Default
in theMinimumLevel
which will change for all your loggers, or you can specify it in theOverride
property, as shown below:Thank you!!!
that work like a charm
This will remove all the "information" level logs. I wonder if this log should be debug level it's really noisy.
I tend to agree - all that noise isn't really "information", more "debug". If we didn't have the power to deactivate I would probably have raised an issue.
However, if you feel this is something that should be changed, reach out to ImageSharp - the exact thing you're looking for is https://github.com/SixLabors/ImageSharp.Web/blob/main/src/ImageSharp.Web/Middleware/LoggerExtensions.cs#L34
I also didn't read your solution closely enough I see that I can set the log level to warning for just the Imagesharp namespace!
For anyone still annoyed by the noisyness of the ImageSharp cluttering up the Information log, I had it completely removed by this Serilog configuration:
That’ll definitely do it, but might make debugging a bit hard if something does go wrong. Setting the level to Fatal or Error may work to remove all the clutter.
All the options for Serilog are mentioned https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level
is working on a reply...