Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

startupitem: add new option startupitem.logfile.stderr, for capturing stderr #296

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

mascguy
Copy link
Member

@mascguy mascguy commented Aug 20, 2023

Presently, when startupitem.logfile is specified, we add a plist entry for stdout logging (via StandardOutPath). But when errors and such occur - particularly due to a fatal startup issue - that output often goes to stderr.

Not capturing the latter, makes troubleshooting more difficult for users. Potentially requiring them to manually edit the plist file, to add an entry for StandardErrorPath themselves.

To ensure the user doesn't have to deal with that, add new option startupitem.logfile.stderr.

By default, it is set to startupitem.logfile. But the user can specify a different logfile, clear the value (to disable stderr logging), or set it independently of startupitem.logfile (if only stderr should be logged).

Fixes: https://trac.macports.org/ticket/67955

@jmroot
Copy link
Member

jmroot commented Aug 20, 2023

I would like a separate option to control where stderr is sent. That can default to the same log as stdout.

@mascguy

This comment was marked as outdated.

@mascguy
Copy link
Member Author

mascguy commented Aug 20, 2023

I would like a separate option to control where stderr is sent. That can default to the same log as stdout.

How about this:

  • Add new option startupitem.logfile.stderr
  • Defaults to startupitem.logfile
  • If cleared, disables stderr logging
  • Can be set independently of startupitem.logfile, if user only wants stderr logging

@mascguy mascguy force-pushed the mascguy-startupitem-logfile branch from a3d5499 to 86bd04a Compare August 20, 2023 12:42
@mascguy mascguy changed the title startupitem.logfile: log to StandardErrorPath too startupitem: add new option startupitem.logfile.stderr, for capturing stderr Aug 20, 2023
@mascguy

This comment was marked as outdated.

@mascguy mascguy requested a review from jmroot August 20, 2023 13:14
@mascguy mascguy force-pushed the mascguy-startupitem-logfile branch from 1dfc296 to a8b2d1f Compare August 20, 2023 13:17
@mascguy
Copy link
Member Author

mascguy commented Aug 21, 2023

PR updated to support new option startupitem.logfile.stderr, along with update to the manpage.

Note: Once we have consensus for all of the details, a corresponding PR will be created to update the MacPorts Guide.

@jmroot jmroot merged commit f488fad into macports:master Nov 8, 2023
4 checks passed
@mascguy mascguy deleted the mascguy-startupitem-logfile branch April 19, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants