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

fix: respect log level settings #904

Merged
merged 1 commit into from
Nov 1, 2024
Merged

fix: respect log level settings #904

merged 1 commit into from
Nov 1, 2024

Conversation

wd
Copy link
Contributor

@wd wd commented Oct 31, 2024

This is an approach to fix #903

However, there are still some info level logs printed.

time="2024-10-31T08:51:43Z" level=info msg=Trace args="[git config user.name argocd]" dir=/tmp/git-rainmaker3532605552 operation_name="exec git" time_ms=1.117718

These logs are generated by codes listed below

  1. https://github.com/argoproj-labs/argocd-image-updater/blob/master/ext/git/client.go#L814
  2. https://github.com/argoproj/argo-cd/blob/master/util/exec/exec.go#L54
  3. https://github.com/argoproj/gitops-engine/blob/master/pkg/utils/tracing/logging.go#L43

They provided a way to set the log level, which is here https://github.com/argoproj/argo-cd/blob/master/util/log/logrus.go#L55. We can use the environment variable ARGOCD_LOG_LEVEL to set the log level. This can be done through the helm chart.

Update:
I test with set below for the helm chart, and it works.

extraEnv:
  - name: ARGOCD_LOG_LEVEL
    value: "warn"

@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.84%. Comparing base (e09b17d) to head (49c3dbd).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
+ Coverage   74.82%   74.84%   +0.01%     
==========================================
  Files          31       31              
  Lines        3912     3915       +3     
==========================================
+ Hits         2927     2930       +3     
  Misses        850      850              
  Partials      135      135              

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

@jannfis
Copy link
Contributor

jannfis commented Oct 31, 2024

Nice! Can you please fix the DCO by signing off your commit?

@wd
Copy link
Contributor Author

wd commented Nov 1, 2024

@jannfis Done. I fixed the CI.

Copy link
Contributor

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jannfis jannfis merged commit 78e925b into argoproj-labs:master Nov 1, 2024
10 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.

There are info level logs even though we set log.level to warn in configmap argocd-image-updater-config
3 participants