anchore / anchore-engine

A service that analyzes docker images and scans for vulnerabilities
Apache License 2.0
1.58k stars 273 forks source link

Feature Request: Add a structured JSON based formatter for logging #298

Open lalbers opened 4 years ago

lalbers commented 4 years ago

Feature Request

Add a structured JSON based formatter for logging Add structured JSON as alternative log format, which can be enabled via config/env. This cloud make the processing of logs (especially filtering) much easier. By mapping JSON fields, it allows a better integration in ELK or similar.

frittentheke commented 4 years ago

This would likely be an easy fix looking at: https://github.com/anchore/anchore-engine/blob/64a7283e2bb9d6271bb048a5f239bd660d150e5d/anchore_engine/subsys/logger.py#L72

Having json fields for i.e. service, name, levelname, ... would be awesome for filtering on those.

ykosaraju commented 4 years ago

+1 to this request

fstendel commented 4 years ago

+1 to this request

zhill commented 4 years ago

Still keen to implement this, but unlikely to make the 0.7.0 release. I'll update the issue if it does get included.

zhill commented 3 years ago

Unfortunately, need to push this to the next release. There is a PR pending for this so we've made good progress and want to get it in the next feature release after 0.9.0 since it will likely impact the configuration and log output behavior of the system.