Skip to content

feat: allow logging output to use JSON formatter #1705

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

Merged
merged 4 commits into from
Sep 16, 2023

Conversation

GridexX
Copy link
Contributor

@GridexX GridexX commented Jul 26, 2023

Title: Enable JSON Logging - PR for Issue #28

Description:

This PR addresses and resolves the long-standing issue #28 in the containrrr/watchtower repository. The issue is related to enabling JSON logging for the application.

Changes:

  • Added a new CLI argument --json-logging that enables the JSON log formatter for logging.
  • Introduced the corresponding environment variable WATCHTOWER_JSON_LOGGING to control JSON logging behavior.
  • Updated the documentation to reflect the new argument and its usage.

Context:

As this is my first-ever Pull Request, I'm excited to contribute to the containrrr/watchtower project. I'm building a log scraping application and enabling JSON logging will greatly facilitate log parsing and analysis in my use case.

Testing:

I have included comprehensive test coverage for the new argument in the flags_test.go file, ensuring proper functionality and compatibility with existing features.

I would greatly appreciate feedback and guidance on any improvements that can be made to this PR. Looking forward to contributing more to the project in the future! Thank you for considering this pull request.

Signed-off-by: GridexX <arsene582@gmail.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congratulations on opening your first pull request! We'll get back to you as soon as possible. In the meantime, please make sure you've updated the documentation to reflect your changes and have added test automation as needed. Thanks! 🙏🏼

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.53% 🎉

Comparison is base (897b171) 68.30% compared to head (4ba4565) 68.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1705      +/-   ##
==========================================
+ Coverage   68.30%   68.83%   +0.53%     
==========================================
  Files          26       26              
  Lines        2407     2448      +41     
==========================================
+ Hits         1644     1685      +41     
  Misses        664      664              
  Partials       99       99              
Files Changed Coverage Δ
internal/flags/flags.go 86.74% <100.00%> (+0.97%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@piksel
Copy link
Member

piksel commented Aug 12, 2023

Apparently, I never submitted the review earlier. Sorry for the take-over.

Does my changes make sense? Again, sorry for the bad communication here.

@piksel piksel force-pushed the feat/json-logging branch from a8344e4 to 426f9ff Compare August 12, 2023 16:17
@GridexX GridexX requested a review from piksel August 16, 2023 05:35
@piksel piksel merged commit 79ebad0 into containrrr:main Sep 16, 2023
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