mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[Issue]: Plugins unable to log #5606
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#5606
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @polyfruitism on GitHub (Apr 14, 2024).
Please describe your bug
When developing a plugin, I noticed that no matter the log settings defined in the logging.json or logging.default.json file, my plugin would not log. After discovery, I found that the ILoggerFactory that is registered with the ServiceProvider used to instantiate objects is the default Microsoft.LoggerFactory, not the SerilogLoggerFactory instantiated in Program.
I believe registering the LoggingFactory instance and Logger<> type in ApplicationHost.RegisterServices the same way that LoggingServiceCollectionExtensions.AddLogging does should resolve this issue.
Reproduction Steps
Environment: Should not matter. I used Docker image latest at time of the report.
Config: logging.json or logging.default.json should be configured such that a plugin is able to log a message at any level.
Steps:
Jellyfin Version
10.8.13
if other:
No response
Environment
Jellyfin logs
FFmpeg logs
No response
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response
Code of Conduct
@crobibero commented on GitHub (Apr 14, 2024):
Logging from a plugin has worked in 10.8, so you will need to provide a specific plugin and what was entered in logging.config
@polyfruitism commented on GitHub (Apr 14, 2024):
For reproducible steps, I performed the following:
As this show has not been previously associated to the AniSearch provider, I would expect to see the log message "Start AniSearch... Searching ({Name})" when searching for metadata for the show.
@crobibero commented on GitHub (Apr 14, 2024):
I just tested with Jellyfin v10.9.0 (master) and plugin v5.2403.6.0 and saw those log lines.
@polyfruitism commented on GitHub (Apr 16, 2024):
Master and 10.8.13 are pretty different right now, given that 10.8.13 appears to be roughly 5 months old and several hundred commits worth of differences. I don't see any code that would resolve this in master (at least based on how I think it should be fixed).
I could accept that it works right now, but are there any other details I can provide to help assess why this consistently fails to work for me?
@crobibero commented on GitHub (Apr 16, 2024):
In 10.8 it was possible for a plugin to disable logging if it registered a service before logging was configured. That has been resolved in 10.9.