https://discord.umbraco.com logo
c
message has been deleted
m
@skttl Nice, also reads like a Clarion call to stop logging to the file system and use a serilog.sink for applicationInsights/seq/a.n.other for proper log management? (might also be nice to centralise dev/staging/live logs in one place) We use the below to cut the Umbraco Disk Logs down to size, but would still have the same issues on cloud/load balancing of machine name stamping and lingering files (though smaller).
Copy code
json
"Serilog": {
  "MinimumLevel": {
    "Default": "Information"
  },
  "WriteTo": [
    {
      "Name": "Async",
      "Args": {
        "configure": [
          {
            "Name": "ApplicationInsights",
            "Args": {
              "connectionString": "_____",
              "telemetryConverter": "Serilog.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights",
              "restrictedToMinimumLevel": "Information"
            }
          }
        ]
      }
    },
    {
      // can't be in async as not a real sink...
      "Name": "UmbracoFile",
      "Args": {
        "RestrictedToMinimumLevel": "Fatal"
      }
    }
  ]
},
s
Yeah we really should do that 🙂 Can we still read the logs in the backoffice log viewer if they are sent to eg. Application Insights and not stored on disk?
m
The only logs that would exist in the on disk logs would be fatal entries at this point. (or whatever level and up you set RestrictedToMinimumLevel for UmbracFile).. and that's the only place the native backoffice log viewer can read from. PS the global minimumlevel has to be higer that the RestrictedToMinimumLevel... eg you can't set minimumLevel to Information, and RestrictedToMinimumLevel to verbose or debug.. you'd still only get informational... Highest DEBUG - VERBOSE - INFORMATION - WARNING - ERROR -FATAL Lowest Sounds like a package though.. to surface external logs in the backoffice of umbraco... (if one doesn't already exist!) 🙂 Though to be honest the native dashboards of the dedicated log managers are way and beyond the backoffice search.. SEQ in particular with tsql querys and custom dashboards, saved filters and workspaces, metrics alerts, retention etc.. https://datalust.co/ (and free to run locally, with realtime streaming of logs) FYI: you can send your logs to any number of sinks... eg UmbracoFile, Console, SEQ, Datadog, Application Insights... could all be added to syndicate your logs..
Also if you've not seen.. request logging middleware with serilog.. (flattens logging per request) that could lower the log sizes.. https://github.com/serilog/serilog-aspnetcore#request-logging and Andrew locks 4 part series to tailor for mvc...https://andrewlock.net/using-serilog-aspnetcore-in-asp-net-core-3-reducing-log-verbosity/
m
Nice.. didn't catch that one in the v13 to v17 migration... Still not sure that the backoffice log viewer offers more than a quick look.. compared to a dedicated log tool dashboard 🙂
w
Yep its UI when I built it - its just MEH and tools like SEQ or AppInsights are more useful for sure
But can be overwhelming as well if you never used them before
So for your use case would still suggest you could get it to read from what other logstore you decide to use, so you have a quick insight into whats going on
Also stumbled across this package - not had chance to use it but looks pretty neat https://marketplace.umbraco.com/package/umbraco.community.logexplorer