You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The only way to configure the formatter applied to Athens' logs is by setting the CloudRuntime / ATHENS_CLOUD_RUNTIME config var. The default value "none" configures unstructured text logging, which is undesirable outside of dev/debug contexts.
Error Message
N/A
To Reproduce
The maximal example config file here says:
# CloudRuntime is the Cloud Provider on which the Proxy/Registry is running.
# Currently available options are "GCP", or "none". Defaults to "none"
# Env override: ATHENS_CLOUD_RUNTIME
CloudRuntime = "none"
We don't run Athens in GCP, so we leave this as-is. When this value is "none", the logger setup code uses devFormatter:
This formatter outputs unstructured text, but we are running Athens in a production context and would like JSON logs to send to our ingest pipeline. I think can work around this by setting CloudRuntime = "anything else", but IMO this coupling is unintuitive.
Expected behavior
JSON logging should be configured by a dedicated config variable, independent of cloud provider.
Environment (please complete the following information):
OS: Ubuntu 22.04 64-bit
Go version: 1.22.0
Proxy version: 0.13.1
Storage (fs/mongodb/s3 etc.): S3
Additional context
N/A
The text was updated successfully, but these errors were encountered:
I agree this isn't the best way to configure a logger. Logrus' API isn't super complex, I think we could probably configure two additional environment variables that configure the logger more succinctly if this value is not set. Something like, ATHENS_LOG_FORMAT (plain/json) and (the existing setting) ATHENS_LOG_LEVEL.
Any other configuration that you think would be needed/appropriate?
Describe the bug
The only way to configure the formatter applied to Athens' logs is by setting the
CloudRuntime
/ATHENS_CLOUD_RUNTIME
config var. The default value"none"
configures unstructured text logging, which is undesirable outside of dev/debug contexts.Error Message
N/A
To Reproduce
The maximal example config file here says:
We don't run Athens in GCP, so we leave this as-is. When this value is
"none"
, the logger setup code usesdevFormatter
:athens/pkg/log/log.go
Lines 22 to 23 in d877af2
This formatter outputs unstructured text, but we are running Athens in a production context and would like JSON logs to send to our ingest pipeline. I think can work around this by setting
CloudRuntime = "anything else"
, but IMO this coupling is unintuitive.Expected behavior
JSON logging should be configured by a dedicated config variable, independent of cloud provider.
Environment (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: