Skip to content

Log File configurable & log error instead of crashing on missing permissions#206

Merged
rwxd merged 2 commits into
mainfrom
issue-205
Apr 8, 2026
Merged

Log File configurable & log error instead of crashing on missing permissions#206
rwxd merged 2 commits into
mainfrom
issue-205

Conversation

@rwxd
Copy link
Copy Markdown
Contributor

@rwxd rwxd commented Apr 7, 2026

Closes #205

The following is now possible:

# Change log file location
LOG_FILE="/var/pdns-proxy.log"

# deactivate log file
LOG_FILE=false

On missing permissions for the file an error is logged, but the app still starts.

I would like to deactivate the log to file functionality entirely as default, but that would be a breaking change.

Maybe if we do a v2 someday.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes file logging configurable via an environment variable and prevents startup failures when the log file can’t be opened (e.g., due to read-only filesystems), aligning with the Kubernetes ReadOnlyRootFilesystem issue in #205.

Changes:

  • Add LOG_FILE env var support to configure the log file path or disable file logging entirely.
  • Wrap file handler initialization in error handling so missing permissions/log path issues don’t crash the app.
  • Document LOG_FILE in the README environment variables section.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
README.md Documents LOG_FILE usage for configuring/disabling file logging
powerdns_api_proxy/logging.py Adds LOG_FILE handling and graceful failure when file logging can’t be enabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread powerdns_api_proxy/logging.py
Comment thread powerdns_api_proxy/logging.py Outdated
@rwxd rwxd merged commit 40976db into main Apr 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default log file breaks Kubernetes ReadOnlyRootFilesystem

3 participants