SeriLog.Expression please #4456

Closed
opened 2026-02-07 00:51:51 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @DocMAX on GitHub (Dec 29, 2022).

Like i sad in #7281 i want to disable some logging. Especially if my source files are temp. not available.
I found out that it can be done in logging.json. But the SeriLog Expression module is missing.
Can you add it?

I allready tried to add with "dotnet add package Serilog.Expressions" but that doesnt work. My json looks like this:
Maybe there is still a mistake in the syntax but i think i'm on the right path,

{
  "Serilog": {
    "Using": ["Serilog.Expressions"],
    "MinimumLevel": {
      "Default": "Warning",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning"
      }
    },
    "Filter": [
      {
        "Name": "ByExcluding",
        "Args": {
          "expression": "Exception contains 'DirectoryNotFoundException'"
        }
      }
    ],
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}"
        }
      },
      {
        "Name": "Async",
        "Args": {
          "configure": [
            {
              "Name": "File",
              "Args": {
                "path": "%JELLYFIN_LOG_DIR%//log_.log",
                "rollingInterval": "Day",
                "retainedFileCountLimit": 3,
                "rollOnFileSizeLimit": true,
                "fileSizeLimitBytes": 100000000,
                "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message}{NewLine}{Exception}"
              }
            }
          ]
        }
      }
    ],
    "Enrich": [ "FromLogContext", "WithThreadId" ]
  }
}

Originally created by @DocMAX on GitHub (Dec 29, 2022). Like i sad in #7281 i want to disable some logging. Especially if my source files are temp. not available. I found out that it can be done in logging.json. But the SeriLog Expression module is missing. Can you add it? I allready tried to add with "dotnet add package Serilog.Expressions" but that doesnt work. My json looks like this: Maybe there is still a mistake in the syntax but i think i'm on the right path, ``` { "Serilog": { "Using": ["Serilog.Expressions"], "MinimumLevel": { "Default": "Warning", "Override": { "Microsoft": "Warning", "System": "Warning" } }, "Filter": [ { "Name": "ByExcluding", "Args": { "expression": "Exception contains 'DirectoryNotFoundException'" } } ], "WriteTo": [ { "Name": "Console", "Args": { "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}" } }, { "Name": "Async", "Args": { "configure": [ { "Name": "File", "Args": { "path": "%JELLYFIN_LOG_DIR%//log_.log", "rollingInterval": "Day", "retainedFileCountLimit": 3, "rollOnFileSizeLimit": true, "fileSizeLimitBytes": 100000000, "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message}{NewLine}{Exception}" } } ] } } ], "Enrich": [ "FromLogContext", "WithThreadId" ] } } ```
OVERLORD added the stale label 2026-02-07 00:51:51 +03:00
Author
Owner

@jellyfin-bot commented on GitHub (Apr 28, 2023):

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

@jellyfin-bot commented on GitHub (Apr 28, 2023): This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments. If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label. This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on [Matrix or Social Media](https://docs.jellyfin.org/general/getting-help.html).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#4456