Skip to content

fix: resolve v1.11.0 log location bugs in baremetal and docker setups#450

Open
TrezorHannes wants to merge 2 commits into
cryptosharks131:v1.11.0from
TrezorHannes:fix/v1.11.0-logging
Open

fix: resolve v1.11.0 log location bugs in baremetal and docker setups#450
TrezorHannes wants to merge 2 commits into
cryptosharks131:v1.11.0from
TrezorHannes:fix/v1.11.0-logging

Conversation

@TrezorHannes

Copy link
Copy Markdown
Contributor

PR: Fix v1.11.0 log location bugs in baremetal and docker setups

Summary of Changes

  • This PR fixes the bugs introduced with the unified logging update in v1.11.0 where relative log paths failed under systemd, staled user configurations, and caused duplicated logs in Docker.

Detailed Changes

  • initialize.py: Configured settings template to construct absolute file paths using BASE_DIR for RotatingFileHandler logs (lndg-controller.log and lndg-web.log).
  • gui/views.py: Resolved GUI /logs view logfile path absolutely using settings.BASE_DIR.
  • systemd.sh / systemd.md: Added WorkingDirectory to systemd service template and redirected stdout/stderr to standard journal instead of /var/log/lndg-controller.log.
  • docker-compose.yaml / README.md: Removed shell file redirection (> /app/data/lndg-controller.log 2>&1) to let Python's internal file rotating handler manage file logging cleanly.

Resolves #449

Testing Strategy

  • Verification: Verified using Django configuration system check (manage.py check) which passes cleanly. Live tested under systemd on VPS, validating that log files are created under user permissions in data/ and updated in real-time.

- Configure initialize.py to use absolute paths based on BASE_DIR for the RotatingFileHandler logging locations.
- Update gui/views.py logs view to use settings.BASE_DIR to construct the absolute path to lndg-controller.log.
- Add WorkingDirectory to systemd service template (systemd.sh/systemd.md) to fix CWD dependencies when starting from systemd (where default CWD is /).
- Change StandardOutput/StandardError to journal in systemd service configuration to prevent root-permission issues and duplicate log writing.
- Remove stdout/stderr file redirection from docker-compose.yaml and README.md to let the application-level RotatingFileHandler handle file logging cleanly without duplication or lock conflicts.

Resolves cryptosharks131#449
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.

1 participant