[PR #2692] [MERGED] Fix log source in log file #3772

Closed
opened 2026-04-25 00:17:00 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/2692
Author: @lkiesow
Created: 2/29/2024
Status: Merged
Merged: 3/1/2024
Merged by: @advplyr

Base: masterHead: log-src


📝 Commits (1)

  • 79d3227 Fix log source in log file

📊 Changes

1 file changed (+13 additions, -12 deletions)

View changed files

📝 server/Logger.js (+13 -12)

📄 Description

The logger should include a source containing the location where the logger was called. This works well for logging to stdout. Unfortunately, the file logs contain the locations where the file logging is called inside of the logger. This is not helpful:

{"timestamp":"2023-11-19 16:35:43","source":"Logger.js:114","message":"[oldDbFiles] Processed db data file with 1 entities","levelName":"INFO","level":2}
{"timestamp":"2023-11-19 16:35:43","source":"Logger.js:114","message":"[oldDbFiles] Finished loading db data with 2 entities","levelName":"INFO","level":2}
{"timestamp":"2023-11-19 16:35:43","source":"Logger.js:114","message":"[oldDbFiles] 2 settings loaded","levelName":"INFO","level":2}

This patch fixes the issue, ensureing that the actual source location will be logged:

{"timestamp":"2024-02-29 18:12:59.832","source":"DailyLog.js:132","message":"[DailyLog] 2024-02-29: Loaded 20 Logs","levelName":"DEBUG","level":1}
{"timestamp":"2024-02-29 18:12:59.638","source":"Server.js:172","message":"=== Starting Server ===","levelName":"INFO","level":2}
{"timestamp":"2024-02-29 18:12:59.638","source":"Server.js:103","message":"[Server] Init v2.8.0","levelName":"INFO","level":2}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/2692 **Author:** [@lkiesow](https://github.com/lkiesow) **Created:** 2/29/2024 **Status:** ✅ Merged **Merged:** 3/1/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `log-src` --- ### 📝 Commits (1) - [`79d3227`](https://github.com/advplyr/audiobookshelf/commit/79d32274aa5c5a5cc02975e3dbc3b36fdebdb3e6) Fix log source in log file ### 📊 Changes **1 file changed** (+13 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `server/Logger.js` (+13 -12) </details> ### 📄 Description The logger should include a source containing the location where the logger was called. This works well for logging to `stdout`. Unfortunately, the file logs contain the locations where the file logging is called inside of the logger. This is not helpful: ``` {"timestamp":"2023-11-19 16:35:43","source":"Logger.js:114","message":"[oldDbFiles] Processed db data file with 1 entities","levelName":"INFO","level":2} {"timestamp":"2023-11-19 16:35:43","source":"Logger.js:114","message":"[oldDbFiles] Finished loading db data with 2 entities","levelName":"INFO","level":2} {"timestamp":"2023-11-19 16:35:43","source":"Logger.js:114","message":"[oldDbFiles] 2 settings loaded","levelName":"INFO","level":2} ``` This patch fixes the issue, ensureing that the actual source location will be logged: ``` {"timestamp":"2024-02-29 18:12:59.832","source":"DailyLog.js:132","message":"[DailyLog] 2024-02-29: Loaded 20 Logs","levelName":"DEBUG","level":1} {"timestamp":"2024-02-29 18:12:59.638","source":"Server.js:172","message":"=== Starting Server ===","levelName":"INFO","level":2} {"timestamp":"2024-02-29 18:12:59.638","source":"Server.js:103","message":"[Server] Init v2.8.0","levelName":"INFO","level":2} ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:00 +02:00
adam closed this issue 2026-04-25 00:17:00 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3772