Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent log file from being overwritten, redirect STDOUT even when not run as daemon, log timestamp #15

Closed
wants to merge 3 commits into from

Conversation

amalek215
Copy link
Contributor

No description provided.

@dwsteele dwsteele self-requested a review January 12, 2021 17:25
@dwsteele dwsteele self-assigned this Jan 12, 2021
Copy link
Collaborator

@dwsteele dwsteele left a comment

Choose a reason for hiding this comment

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

This seems like 3 PRs to me:

  1. Add timestamp to log (looks very committable if applied to all cases)
  2. Don't overwrite log file (also very committable)
  3. Redirect stdout to log (needs discussion)

Please separate #1 and #2 into separate PRs so they can be committed and leave this PR for the STDOUT topic.

# always redirect stdout to logfile
open (STDOUT, '>&', $hLog)
or confess "Couldn't close standard output and redirect to logfile: $!";

# Daemonize the process
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would you like to make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the issue is when run as a systemd process without the --daemon flag all of the print statements do not make it into the logfile
I will also make this its own PR

@dwsteele
Copy link
Collaborator

Closing since this PR was split into #18, #19, #20.

@dwsteele dwsteele closed this May 11, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants