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

Logging timestamps should be optional #6163

Closed
erikarvstedt opened this issue Jan 14, 2022 · 9 comments · Fixed by #9083
Closed

Logging timestamps should be optional #6163

erikarvstedt opened this issue Jan 14, 2022 · 9 comments · Fixed by #9083
Assignees
Labels
feature request Requests for new features logging Related to the logging / debug output functionality P4 low prio

Comments

@erikarvstedt
Copy link
Contributor

erikarvstedt commented Jan 14, 2022

lnd always prints timestamps in log messages.
This is redundant in systemd services (where log messages are automatically timestamped) and should be made optional.
This SO post shows how this can be achieved

@redek-zelton
Copy link

Check this: https://newreleases.io/project/github/lightningnetwork/lnd/release/v0.13.0-beta.rc3.

Your Logging timestamps is useful for your peer. He should know when was your last log.

@erikarvstedt
Copy link
Contributor Author

erikarvstedt commented Jan 15, 2022

@redek-zelton, how is the link relevant to this issue?

@redek-zelton
Copy link

ah sorry my bad, it's a suggestion.

@HannahMR HannahMR added the P4 low prio label Jan 17, 2022
@Roasbeef Roasbeef added feature request Requests for new features logging Related to the logging / debug output functionality labels Jan 18, 2022
@imskr
Copy link

imskr commented Jan 20, 2022

Can I work on this? @Roasbeef

@erikarvstedt
Copy link
Contributor Author

Note to implementers:

  • bitcoind has option logtimestamps (default: true)
  • clightning has option log-timestamps(default: true)

lnd should use one of these names.

@guggero
Copy link
Collaborator

guggero commented Jan 20, 2022

Unfortunately the command line flag parsing library we use cannot have boolean values with default value true (because you cannot specify --myflag=false). So it would need to be inverted. I'm voting for disable-log-timestamps.

@qustavo
Copy link

qustavo commented Feb 2, 2022

@guggero looks like the convention is to use the --no prefix flag (i.e --no-macaroons or --no-listen')

@ellemouton
Copy link
Collaborator

Note that when #9083 is in, then this should be quite easy to do by passing options to the Handlers we define there :) (ie, no need to pass options to the btclog package anymore)

@ellemouton
Copy link
Collaborator

Ok, #9083 has now been updated to address this issue.

With that PR, you will now be able to do: --logging.console.no-timestamps and or --logging.file.no-timestamps to omit timestamps for the stdout logger or log file logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new features logging Related to the logging / debug output functionality P4 low prio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants