[PR #3919] [MERGED] Fix Logger.fatal to ensure crash_logs.txt is written to #4118

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3919
Author: @advplyr
Created: 1/31/2025
Status: Merged
Merged: 1/31/2025
Merged by: @advplyr

Base: masterHead: fix_logger_fatal


📝 Commits (1)

  • c3aad94 Fix Logger.fatal to be a promise to ensure crash_logs.txt write

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 server/Logger.js (+2 -2)

📄 Description

Brief summary

Logger.fatal is called before the server closes on uncaught exceptions. When it gets called the log is written to crash_logs.txt.

Logs weren't always being written to crash_logs.txt because Logger.fatal wasn't a promise and process.exit was called before it was done.

Which issue is fixed?

No issue

How have you tested this?

Threw some exceptions and ensured they were written to crash_logs.txt


🔄 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/3919 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 1/31/2025 **Status:** ✅ Merged **Merged:** 1/31/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix_logger_fatal` --- ### 📝 Commits (1) - [`c3aad94`](https://github.com/advplyr/audiobookshelf/commit/c3aad9486c6036c6fcc30102a2e988a8ae198fbd) Fix Logger.fatal to be a promise to ensure crash_logs.txt write ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/Logger.js` (+2 -2) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary `Logger.fatal` is called before the server closes on uncaught exceptions. When it gets called the log is written to `crash_logs.txt`. Logs weren't always being written to crash_logs.txt because `Logger.fatal` wasn't a promise and `process.exit` was called before it was done. ## Which issue is fixed? No issue ## How have you tested this? Threw some exceptions and ensured they were written to crash_logs.txt --- <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:18:23 +02:00
adam closed this issue 2026-04-25 00:18:23 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4118