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

Add structured logger #54

Merged
merged 5 commits into from
Mar 16, 2021

Conversation

nishkrishnan
Copy link
Contributor

This is two changes:

  • Replacing all usages of SimpleLogger with it's interface SimpleLogging which makes it easier to swap out loggers going forward
  • Nukes SimpleLogger in favor of StructuredLogger which allows us to better analyze logs in our log management system we choose.

Right now the real changes are scopped to simple_logger.go and logging_test the rest of the changes are just interface changes + test changes to support the new constructor for NoopLogger

Note: As a base logger I'm using zap

@msarvar
Copy link

msarvar commented Mar 16, 2021

Are we planning on upstreaming this? I worry that replacing simple logging will cause issues to other atlantis users. If they have some sort of log parser that relies on current non structured format.

Copy link

@msarvar msarvar left a comment

Choose a reason for hiding this comment

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

great job!

@nishkrishnan
Copy link
Contributor Author

nishkrishnan commented Mar 16, 2021

Are we planning on upstreaming this? I worry that replacing simple logging will cause issues to other atlantis users. If they have some sort of log parser that relies on current non structured format.

Yeah but I'd argue this is objectively way better than what exists and can be coupled with a major release. Parsing the existing format seems like a nightmare and the existing format doesn't play nice with any log ingestion system.

Though this is a good callout for sure. Maybe it could be wise to add a server flag to basically fork between structured logging and simple logging but seems like a lot of work right now for our usecase, we can discuss it in the upstream PR.

@nishkrishnan nishkrishnan merged commit 7ccd732 into release-v0.17.0-beta-lyft.1 Mar 16, 2021
@nishkrishnan nishkrishnan deleted the add-structured-logging branch March 16, 2021 19:10
nishkrishnan added a commit that referenced this pull request Mar 19, 2021
nishkrishnan added a commit that referenced this pull request Apr 12, 2021
This is two changes:

Replacing all usages of SimpleLogger with it's interface SimpleLogging which makes it easier to swap out loggers going forward
Nukes SimpleLogger in favor of StructuredLogger which allows us to better analyze logs in our log management system we choose.
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