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

Added isoTimestamp option #4518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nkiesel
Copy link

@nkiesel nkiesel commented Jul 27, 2024

When set to true, it renders the timestamp in log entries using Date.toIsoString(), which is easier to read by humans than the default of milliseconds.

When set to true, it renders the timestamp in log entries using Date.toIsoString(), which
is easier to read by humans than the default of milliseconds.
Copy link
Contributor

@kanongil kanongil left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

I have definitely been bothered about having to convert numbered timestamps to a human readable format, so understand the use case.

I don't however think that this is the best way about it, as other tools might require the timestamp to be a number. This is really more of a formatting issue, which would be better solved in the logging tool that displays the value.

@nkiesel
Copy link
Author

nkiesel commented Jul 28, 2024

Given that this can be configured, why is that an issue for other tools? I looked at the podium repo - which I think is used by Hapijs - for adding the formatting, but could not see how/where to add that. I also thought to pass the formatted timestamp, but that is currently a number and anyway looks to me the passed optional timestamp is ignored.

I would be happy to add another PR, but would need some advice how/where to do this.

@kanongil
Copy link
Contributor

Hapi will not display the timestamp, so it will be some other plugin or user code that renders it.

Podium just forwards the event to any registered listeners, and should definitely not change the format.

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.

2 participants