-
Notifications
You must be signed in to change notification settings - Fork 486
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
Improvement/Support JSON log output #799
Labels
Comments
@blotus is the log configuration only for |
@nanikjava To answer your question it would be crowdsec agent itself than the CLI since the cli already support |
This would be a nice feature to have because structured logging is quite important for a security tool. |
I support the idea |
This improvement will be added with this one #2941 |
mmetc
added a commit
that referenced
this issue
Dec 23, 2024
* make it possible to enable json log * fix * fix typo * fix typo * fix typo * fix typo * fix typo * fix typo * Add error handling * Add log_format to default config * Fix syntax error in if statement * Fix typo * Fix typo * Fix some typos and change naming from native to text, makes more sense * Set same timestamp format for json logging * Fix formatting * Move in if statement under previous * Fix some formatting that got messed up * Default to text formatter, if log_format is not configured. * defining logFormatter outside if statement so that log.SetFormatter(logFormatter) is not undefined when function is called * Add variables that were undefined * Argument were missing when calling SetDefaultLoggerConfig function * Fix order of arguments passed * Fix order of arguments passed * Fix typo * Implicit log_format = "text" * functional test * ignore log_format in FatalHook * make it possible to enable json log * fix * fix typo * fix typo * fix typo * fix typo * fix typo * fix typo * Add error handling * Add log_format to default config * Fix syntax error in if statement * Fix typo * Fix typo * Fix some typos and change naming from native to text, makes more sense * Set same timestamp format for json logging * Fix formatting * Move in if statement under previous * Fix some formatting that got messed up * Default to text formatter, if log_format is not configured. * defining logFormatter outside if statement so that log.SetFormatter(logFormatter) is not undefined when function is called * Add variables that were undefined * Argument were missing when calling SetDefaultLoggerConfig function * Fix order of arguments passed * Fix order of arguments passed * Fix typo * Implicit log_format = "text" * functional test * ignore log_format in FatalHook * lint * fix func test * lint * remove < > characters from log --------- Co-authored-by: Victor Edvardsson <victor.edvardsson@loopia.se> Co-authored-by: marco <marco@crowdsec.net> Co-authored-by: Thibault "bui" Koechlin <thibault@crowdsec.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
We use logrus to handle all of crowdsec logs.
As logrus natively supports a JSON formatter, we should allow users to configure which output format they want (either plaintext or JSON).
The text was updated successfully, but these errors were encountered: