Copied to clipboard

Flag this post as spam?

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


  • Emil Schoelzer Schnohr 24 posts 144 karma points
    Mar 22, 2021 @ 13:58
    Emil Schoelzer Schnohr
    0

    Ucommerce 9 - Spam in logs: "Running ToList() query on index"

    I have this Ucommerce 9 webshop running, but just deleted 7gb of log files generated over a few months. There are no errors in them, just loads of lines starting with "Running ToList() query on index at".

    It seems to be from my navigation controller which returns a partial view with a category navigation. It gets these categories from the Ucommerce CatalogLibrary API (e.g. catalogLibrary.GetCategory). So everytime I reload the page, it adds about 80kb to the log file spammed with this line.

    I am wondering if I've just coded it in an inefficient way. But the rather low traffic shop runs fine, so a decent fix for me right now would be to just disable this logging. Do you know if I can control what Ucommerce is logging somewhere, or maybe even disable it?

    Thanks!

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Mar 22, 2021 @ 19:51
    Marc Goodson
    0

    HI Emil

    I think you can override the level of serilogging on a namespace specific basis, so if you know the namespace responsible for the Running ToList query on index at, then I think you can change it from the default 'information' to be something more pragmatic like 'error'

    https://our.umbraco.com/documentation/reference/config/Serilog/#changing-the-log-level-for-specific-namespaces

    I don't think there is an 'off' option, but my guess is they are not logging that message as an 'error'..

    regards

    marc

  • Emil Schoelzer Schnohr 24 posts 144 karma points
    Mar 30, 2021 @ 07:19
    Emil Schoelzer Schnohr
    0

    Thanks it helped a lot. Though I couldn't figure out the namespace, I just changed the minimum log level in serilog.config from "Debug" to "Warning". So only warnings and errors gets logged.

    <add key="serilog:write-to:File.restrictedToMinimumLevel" value="Warning" />
    
Please Sign in or register to post replies

Write your reply to:

Draft