control-service: Format logs in JSON - #308
Conversation
dd9f6b2 to
ad13de4
Compare
ad13de4 to
f1e7a07
Compare
|
In the commit message, the problem statement can be generalized. We are not adding some specific support for Kibana. What we are doing would make it better for Kibana users. Please fix it since some reading it may think this is a very specific feature and it is not. |
|
I almost forgot : From https://github.com/vmware/versatile-data-kit/blob/main/CONTRIBUTING.md#how-to-submit-and-merge
/offtopic: |
f1e7a07 to
8739f42
Compare
Control Service logs must be formatted in JSON to be able to be parsed correctly in Kibana. This change adds an encoder which formats logs in JSON for an instance of the Control Service with the LOGGING_SYS_LOG_HOST env variable defined. Testing done: ran CS with the encoder set for local logs Signed-off-by: gageorgiev <gageorgiev@vmware.com>
8739f42 to
68e5754
Compare
Control Service logs must be able to be formatted in JSON using an environment variable due to the importance of structured logging capability. This change adds an encoder which formats logs in JSON for an instance of the Control Service with the LOGGING_FORMAT environment variable set to JSON. This change lets us to retain the previous log config while still allowing us the freedom to configure a logger to format logs to JSON. Logging configuration should be much more in depth, however it would require changes outside of the scope of the current story. Testing done: ran CS with the encoder set for local logs and the LOGGING_FORMAT env variable set to JSON and observed the logs, also with other values and saw that the logs were formatted in the default format. Signed-off-by: gageorgiev <gageorgiev@vmware.com>
Control Service logs must be able to be formatted in JSON using
an environment variable due to the importance of structured logging
capability. This change adds an encoder which formats logs in JSON
for an instance of the Control Service with the LOGGING_FORMAT
environment variable set to JSON.
This change allows us to retain the previous log config while
still allowing us the freedom to configure a logger to format logs
to JSON. Logging configuration should be much more in depth,
however it would require changes outside of the scope of the
current story.
Testing done: ran CS with the encoder set for local logs and the
LOGGING_FORMAT env variable set to JSON and observed the logs,
also with other values and saw that the logs were formatted in
the default format.
Signed-off-by: gageorgiev gageorgiev@vmware.com