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

feat(backend): add configurable logger #147

Merged
merged 15 commits into from
Feb 19, 2025
Merged

feat(backend): add configurable logger #147

merged 15 commits into from
Feb 19, 2025

Conversation

Holzchopf
Copy link
Contributor

@Holzchopf Holzchopf commented Feb 13, 2025

Changes

Added Logger class that allows

  • logging messages of different levels (TRACE | DEBUG | INFO | WARN | ERROR | FATAL)
  • uniformly formatting log messages
  • configuring log output level (ALL | TRACE | DEBUG | INFO | WARN | ERROR | FATAL | OFF)

Related issues

Closes #53

Request for Comment

  • Risk: low
  • Discussion: high
    • default log level is INFO
    • log pattern is %d %-5p [%c]: %m
    • logs go to stdout
    • messages are JSON (per log4js default)
2025-02-14T14:11:49.844 WARN  [config]: ["Using defaults for keycloak",{"url":"http://localhost:8081","realm":"netzgrafikeditor"}]
2025-02-14T14:11:49.860 INFO  [migration]: ["Migrating \"TABLE SCHEMA benchmarks v1\" …"]
2025-02-14T14:11:49.868 ERROR [ampq]: [{"errno":-4078,"code":"ECONNREFUSED","syscall":"connect","address":"::1","port":5672}]

Checklist

  • Document changes in this pull request above.
  • Documentation is added in the docs folder for relevant behavior changes.
  • Technical guidelines listed in docs/CONTRIBUTING.md are followed.

@Holzchopf
Copy link
Contributor Author

@chenkins Could you have a look and let me know what you think about the defaults? Once settled, I will update the backend README.

@Holzchopf Holzchopf marked this pull request as ready for review February 14, 2025 13:46
@Holzchopf Holzchopf requested a review from a team as a code owner February 14, 2025 13:46
Copy link
Contributor

@chenkins chenkins left a comment

Choose a reason for hiding this comment

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

Lgtm, some questions.

@chenkins chenkins self-requested a review February 19, 2025 13:38
Copy link
Contributor

@chenkins chenkins left a comment

Choose a reason for hiding this comment

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

lgtm apart from missing test coverage. Open an issue once for once we have unit test setup in place?

@Holzchopf Holzchopf merged commit e8a3b64 into main Feb 19, 2025
1 check passed
@Holzchopf Holzchopf deleted the backend-logger branch February 19, 2025 16:12
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.

Use custom logger in fab-backend
3 participants