Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Damiano Piva 5 posts 85 karma points
    Mar 08, 2023 @ 08:50
    Damiano Piva
    0

    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

  • Richard Ockerby 28 posts 202 karma points MVP 3x c-trib
    Apr 04, 2023 @ 16:47
    Richard Ockerby
    105

    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:

    {
      ...
      "Serilog": {
        "MinimumLevel": {
          "Default": "Information",
          "Override": {
            ...
            "SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware": "Warning"
          }
        }
      },
      ...
    }
    
  • Damiano Piva 5 posts 85 karma points
    Apr 05, 2023 @ 07:03
    Damiano Piva
    0

    Thank you!!!

    that work like a charm

  • Murray Roke 503 posts 966 karma points c-trib
    Nov 08, 2023 @ 23:10
    Murray Roke
    0

    This will remove all the "information" level logs. I wonder if this log should be debug level it's really noisy.

  • Richard Ockerby 28 posts 202 karma points MVP 3x c-trib
    Nov 08, 2023 @ 23:31
    Richard Ockerby
    0

    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

  • Murray Roke 503 posts 966 karma points c-trib
    17 days ago
    Murray Roke
    0

    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!

Please Sign in or register to post replies

Write your reply to:

Draft