From 1f71663ecb69ae2e2ced3ec46245b8add63020b6 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Sat, 2 Nov 2024 00:34:53 +0500 Subject: [PATCH] Configure jellyfin logging --- roles/jellyfin/tasks/main.yml | 6 ++++++ roles/jellyfin/templates/logging.json.j2 | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 roles/jellyfin/templates/logging.json.j2 diff --git a/roles/jellyfin/tasks/main.yml b/roles/jellyfin/tasks/main.yml index bf96fee..8411f09 100644 --- a/roles/jellyfin/tasks/main.yml +++ b/roles/jellyfin/tasks/main.yml @@ -6,6 +6,12 @@ loop: - jellyfin-cache - jellyfin-config +- name: Copy logging config + become: true + ansible.builtin.template: + src: logging.json.j2 + dest: /var/lib/docker/volumes/jellyfin-config/_data/config/logging.json + mode: "0644" - name: Run jellyfin become: true community.docker.docker_container: diff --git a/roles/jellyfin/templates/logging.json.j2 b/roles/jellyfin/templates/logging.json.j2 new file mode 100644 index 0000000..7d04a55 --- /dev/null +++ b/roles/jellyfin/templates/logging.json.j2 @@ -0,0 +1,21 @@ +{ + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "System": "Warning", + "Jellyfin.Api.Controllers.UniversalAudioController": "Warning" + } + }, + "WriteTo": [ + { + "Name": "Console", + "Args": { + "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}" + } + } + ], + "Enrich": [ "FromLogContext", "WithThreadId" ] + } +}