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 seconds to logger timestamp #2770

Merged
merged 1 commit into from
Aug 24, 2019
Merged

Added seconds to logger timestamp #2770

merged 1 commit into from
Aug 24, 2019

Conversation

rubiin
Copy link
Contributor

@rubiin rubiin commented Aug 19, 2019

At the moment only hours and minutes are logged in the default Logger implementation.

This pull request add seconds to default logger format.

Note that I don't want to override the whole logger service. It's pretty nice, I just want another timestamp format

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

The logger now shows seconds

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

At the moment only hours and minutes are logged in the default Logger implementation.

This pull request add seconds to default logger format.

Note that I don't want to override the whole logger service. It's pretty nice, I just want another timestamp format
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4116

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.236%

Totals Coverage Status
Change from base Build 4098: 0.0%
Covered Lines: 3638
Relevant Lines: 3820

💛 - Coveralls

Copy link
Member

@BrunnerLivio BrunnerLivio left a comment

Choose a reason for hiding this comment

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

Thanks a lot, looks good :)

@rubiin
Copy link
Contributor Author

rubiin commented Aug 21, 2019

Okay cool

@nonplus
Copy link
Contributor

nonplus commented Aug 23, 2019

FWIW, in log files it makes more sense to use an ISO timestamp, e.g.

const timestamp = new Date().toISOString();

This way you get millisecond resolution and a canonical format:

[Nest] 32061   - 2019-08-23T05:15:27.193Z   [NestFactory] Starting Nest application...
[Nest] 32061   - 2019-08-23T05:15:27.207Z   [InstanceLoader] AppModule dependencies initialized
Etc.

@kamilmysliwiec kamilmysliwiec added this to the 6.6.0 milestone Aug 24, 2019
@kamilmysliwiec kamilmysliwiec changed the base branch from master to 6.6.0 August 24, 2019 17:34
@kamilmysliwiec kamilmysliwiec merged commit 311265f into nestjs:6.6.0 Aug 24, 2019
@kamilmysliwiec
Copy link
Member

Thanks!

@rubiin
Copy link
Contributor Author

rubiin commented Aug 26, 2019

Glad to be of help

@rubiin
Copy link
Contributor Author

rubiin commented Sep 2, 2019

@BrunnerLivio @kamilmysliwiec How can I add myself on the contributor list?

@kamilmysliwiec
Copy link
Member

Contributors section is automatically created by GitHub

@rubiin
Copy link
Contributor Author

rubiin commented Sep 2, 2019

Thats odd though my PR was merged, I dont see my profile there @kamilmysliwiec

@BrunnerLivio
Copy link
Member

@rubiin Your commit could not be mapped with your Github account. As you can see in the commit, the commit-image is the "blank"-default Github avatar.

As far as I know you need to have the exact same email address configured in git using git config user.email --global your@email.com as the one you are using for Github.

Unfortunately, since the PR is already merged, we won't be able to revert that. For upcoming PRs check your account is correctly map with your commits, so your contributions will show up in the contributors chart :)

@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants