diff --git a/Jellyfin.Webhooks/EntryPoint.cs b/Jellyfin.Webhooks/EntryPoint.cs index 96b2a88..0099ff6 100644 --- a/Jellyfin.Webhooks/EntryPoint.cs +++ b/Jellyfin.Webhooks/EntryPoint.cs @@ -356,15 +356,21 @@ private async Task ExecuteWebhook(EventInfo request) { var hooks = Plugin.Instance.Configuration.Hooks .Where(h => h.Events.Contains(request.Event)); + + _logger.LogInformation("ExecuteWebhook: hooks {hooks}, event: {evt}", hooks.Count(), request.Event); + foreach (var hook in hooks) { if (!string.IsNullOrEmpty(hook.UserId) && request.User?.Id.ToString("N") != hook.UserId) + { + _logger.LogWarning("ExecuteWebhook: user mismatch, hook.UserId: {hookUserId}, request.User: {reqUser}, event: {evt}", hook.UserId, request.User, request.Event); continue; + } var formatter = _formatFactory.CreateFormat(hook.Format); try { - _logger.LogInformation("ExecuteWebhook: {id}, format: {format}, url: {url}", hook.Id, hook.Format, hook.Url); + _logger.LogInformation("ExecuteWebhook: {id}, format: {format}, url: {url}, event: {evt}", hook.Id, hook.Format, hook.Url, request.Event); await formatter.Format(new Uri(hook.Url), request); } catch (Exception e) diff --git a/Jellyfin.Webhooks/Formats/DefaultFormat.cs b/Jellyfin.Webhooks/Formats/DefaultFormat.cs index 258cffe..620ae8d 100644 --- a/Jellyfin.Webhooks/Formats/DefaultFormat.cs +++ b/Jellyfin.Webhooks/Formats/DefaultFormat.cs @@ -47,9 +47,9 @@ public async Task Format(Uri url, EventInfo info) var contentJson = JsonSerializer.Serialize(body, JsonDefaults.Options); var content = new StringContent(contentJson, Encoding.UTF8, "application/json"); - _logger.LogInformation("Calling url: {url} (size: {size})", url, contentJson.Length); + _logger.LogInformation("Calling url: {url} (size: {size}), event: {evt}", url, contentJson.Length, info.Event); var response = await _http.PostAsync(url, content); - _logger.LogInformation($"Response: {response}"); + _logger.LogInformation("event: {evt}, Response: {response}", info.Event, response); } }