Skip to content

Conversation

@eunyoung14
Copy link
Member

Summary

  • Remove lumberjack dependency for log rotation
  • Output logs to stderr for systemd/journald to capture
  • Update systemd service configuration to use journald
  • Add log viewing instructions to README

Why

Follow Linux-native logging conventions. Let systemd/journald handle log collection and rotation instead of application-level log rotation with lumberjack.

Test plan

  • Verify logs appear in journald: journalctl -u alpamon -f
  • Confirm no file is created at /var/log/alpamon/alpamon.log
  • Test log filtering commands from README

- Remove lumberjack dependency for log rotation
- Output logs to stderr for systemd/journald to capture
- Update systemd service to use journald (StandardOutput/Error=journal)
- Add log viewing instructions to README
Copilot AI review requested due to automatic review settings December 22, 2025 14:35
Copy link
Contributor

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 refactors the logging mechanism to use systemd's journald instead of application-level log rotation with lumberjack, following Linux-native logging conventions.

  • Removes the lumberjack dependency and file-based logging
  • Redirects all logs to stderr for systemd/journald capture
  • Updates systemd service configuration to properly integrate with journald

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/logger/logger.go Simplified InitLogger() to write to stderr instead of files; removed lumberjack configuration and return value
cmd/alpamon/command/root.go Updated gracefulShutdown() signature and all call sites to remove lumberjack logger parameter and cleanup logic
go.mod Removed lumberjack dependency from module requirements
go.sum Removed lumberjack dependency checksums
configs/alpamon.service Configured StandardOutput/StandardError to use journald with SyslogIdentifier
README.md Added comprehensive documentation for viewing logs using journalctl commands

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

@geunwoonoh geunwoonoh merged commit e750b93 into main Dec 23, 2025
5 checks passed
@geunwoonoh geunwoonoh deleted the refactor/remove-lumberjack-use-stdout branch December 23, 2025 02:45
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.

3 participants