docker run --rm -it \
\
-v ~/.kube/config:/kube/config \
-e KUBECONFIG=/kube/config \
-e LOG_JSON=true \
document-processing-operator:latest
{"channel": "MAIN", "exception": null, "level": "info", "message": "Running Python Operator", "num_indent": 0, "process": 7, "thread": 139932219877184, "threadName": "MainThread", "thread_id": 139932219877184, "timestamp": "2024-03-29T17:25:08.116860"}
{"channel": "MAIN", "exception": null, "level": "info", "message": "Starting Watches", "num_indent": 0, "process": 7, "thread": 139932219877184, "threadName": "MainThread", "thread_id": 139932219877184, "timestamp": "2024-03-29T17:25:08.125099"}
{"channel": "PYTHW", "exception": null, "level": "info", "message": "Starting PythonWatchManager: Watch[<class 'document_processing.controller.DocumentProcessingController'>]", "num_indent": 0, "process": 7, "thread": 139932219877184, "threadName": "MainThread", "thread_id": 139932219877184, "timestamp": "2024-03-29T17:25:08.125320"}
{"channel": "TRDUTLS", "exception": null, "level": "info", "message": "Starting TimerThread: timer_thread", "num_indent": 0, "process": 7, "thread": 139932219877184, "threadName": "MainThread", "thread_id": 139932219877184, "timestamp": "2024-03-29T17:25:08.125966"}
{"channel": "TRDUTLS", "exception": null, "level": "info", "message": "Starting ReconcileThread: reconcile_thread", "num_indent": 0, "process": 7, "thread": 139932219877184, "threadName": "MainThread", "thread_id": 139932219877184, "timestamp": "2024-03-29T17:25:08.129462"}
{"channel": "TRDUTLS", "exception": null, "level": "info", "message": "Starting WatchThread: watch_thread_watsonx.ibm.com/v1_DocumentProcessing", "num_indent": 0, "process": 7, "thread": 139932219877184, "threadName": "MainThread", "thread_id": 139932219877184, "timestamp": "2024-03-29T17:25:08.131324"}
Describe the bug
I've got the following annotations on my CR but I don't see JSON logs in the operator either locally or in the pod. Anything obvious that I'm missing here?
Platform
Please provide details about the environment you are using, including the following:
Sample Code
Logs with the CR annotated while running our operator locally
Logs with LOG_JSON set in the container's env
Expected behavior
JSON logs when the CR is annotated correctly
Observed behavior
Logs not in JSON when the CR is annotated correctly
Additional context
JSON logging works with env var, issue is specific to CR annotations