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

CSS-11598: Improve logging #1411

Merged
merged 11 commits into from
Oct 23, 2024
Merged

Conversation

SimoneDutto
Copy link
Contributor

@SimoneDutto SimoneDutto commented Oct 22, 2024

Description

This pr includes:

  • request logger middleware
  • local logger with colours
  • local logger configured for suites
  • production logger default config

Some examples:

image

image

Updated examples:
image

Fixes JIRA/GitHub issue number

Engineering checklist

Check only items that apply

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

Test instructions

Notes for code reviewers

@SimoneDutto SimoneDutto requested a review from a team as a code owner October 22, 2024 09:14
Copy link
Contributor

@ale8k ale8k left a comment

Choose a reason for hiding this comment

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

See my comment on default_logger as to why I'm requesting changes. Good work so far!

internal/logger/default_logger.go Outdated Show resolved Hide resolved
internal/logger/http_logger.go Show resolved Hide resolved
internal/logger/default_logger.go Show resolved Hide resolved
babakks
babakks previously approved these changes Oct 22, 2024
cmd/jimmsrv/service/service.go Outdated Show resolved Hide resolved
internal/logger/default_logger.go Outdated Show resolved Hide resolved
cmd/jimmsrv/main.go Outdated Show resolved Hide resolved
docker-compose.common.yaml Outdated Show resolved Hide resolved
internal/logger/default_logger.go Outdated Show resolved Hide resolved
internal/logger/default_logger.go Outdated Show resolved Hide resolved
internal/logger/default_logger_test.go Outdated Show resolved Hide resolved
babakks
babakks previously approved these changes Oct 22, 2024
@SimoneDutto SimoneDutto changed the title Improve logging CSS-11598: Improve logging Oct 22, 2024
@SimoneDutto
Copy link
Contributor Author

@ale8k @babakks the production config with zap is to log into stderr. Is it a problem for charms/rock?

Copy link
Contributor

@ale8k ale8k left a comment

Choose a reason for hiding this comment

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

Some comments

internal/testutils/loggingsuite/loggingsuite.go Outdated Show resolved Hide resolved
internal/testutils/loggingsuite/loggingsuite.go Outdated Show resolved Hide resolved
internal/testutils/loggingsuite/loggingsuite.go Outdated Show resolved Hide resolved
internal/testutils/cmdtest/jimmsuite.go Outdated Show resolved Hide resolved
internal/logger/default_logger.go Show resolved Hide resolved
internal/logger/http_logger.go Outdated Show resolved Hide resolved
internal/logger/http_logger.go Show resolved Hide resolved
babakks
babakks previously approved these changes Oct 23, 2024
internal/logger/default_logger_test.go Outdated Show resolved Hide resolved
internal/logger/default_logger_test.go Outdated Show resolved Hide resolved
@SimoneDutto SimoneDutto merged commit 5ea27ad into canonical:v3 Oct 23, 2024
4 checks passed
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.

4 participants