crowdsec icon indicating copy to clipboard operation
crowdsec copied to clipboard

Add possibility to configure log format #799

Open victoredvardsson opened this issue 10 months ago • 10 comments

https://github.com/crowdsecurity/crowdsec/issues/799

logrus which is used as logging backend supports json formatter.

This change makes it possible to configure either text or json output.

victoredvardsson avatar Apr 14 '24 18:04 victoredvardsson

@victoredvardsson: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

github-actions[bot] avatar Apr 14 '24 18:04 github-actions[bot]

@victoredvardsson: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

github-actions[bot] avatar Apr 14 '24 18:04 github-actions[bot]

/kind feature

victoredvardsson avatar Apr 14 '24 18:04 victoredvardsson

/area configuration

victoredvardsson avatar Apr 14 '24 18:04 victoredvardsson

Codecov Report

Attention: Patch coverage is 70.73171% with 12 lines in your changes missing coverage. Please review.

Project coverage is 38.85%. Comparing base (e3c6a5b) to head (5cfc3c5). Report is 74 commits behind head on master.

Files Patch % Lines
cmd/crowdsec/fatalhook.go 61.11% 7 Missing :warning:
pkg/types/utils.go 68.75% 5 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2941       +/-   ##
===========================================
+ Coverage   27.54%   38.85%   +11.30%     
===========================================
  Files         398      399        +1     
  Lines       57920    57952       +32     
===========================================
+ Hits        15954    22515     +6561     
+ Misses      40028    32951     -7077     
- Partials     1938     2486      +548     
Flag Coverage Δ
bats 30.19% <93.54%> (?)
unit-linux 35.07% <32.25%> (+0.01%) :arrow_up:
unit-windows 25.57% <2.43%> (-0.01%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 15 '24 13:04 codecov-commenter

Looks like all checks went through now 👍

victoredvardsson avatar Apr 15 '24 19:04 victoredvardsson

I still need to add a formatter for stderr when the rest of the messages goes to a file. We don't want fatal errors to be formatted in json for this case. Will do asap and merge for 1.6.2

mmetc avatar May 07 '24 15:05 mmetc

merge is postponed to 1.6.3 since I'd like to correctly bubble up errors from goroutines and 1.6.2 is too soon

mmetc avatar May 16 '24 07:05 mmetc

merge is postponed to 1.6.3 since I'd like to correctly bubble up errors from goroutines and 1.6.2 is too soon

We keeping 1.6.3 or moving to 1.6.4?

LaurenceJJones avatar Jun 25 '24 12:06 LaurenceJJones

Next one, I'd rather remove the remaining os.Exit and log.Fatal before implementing this

mmetc avatar Jun 25 '24 13:06 mmetc