Ben Davison
06/09/2020, 11:44 AM- name: PREFECT__LOGGING__FORMAT
value: '{"level": "%(levelname)s", "message": "%(message)s"}'
And I can see the pod has the environment variable set.
kubectl exec -it prefect-scheduler-6b96994c6-qtqh5 --namespace=data -- /bin/sh -c 'echo "password: $PREFECT__LOGGING__FORMAT"' <aws:default>
password: {"level": "%(levelname)s", "message": "%(message)s"}
But the logs are still in the default format:
kubectl --namespace data logs prefect-scheduler-6b96994c6-qtqh5 -f <aws:default>
[2020-06-09 11:36:54,302] INFO - prefect-server.Scheduler | Scheduler will start after an initial delay of 275 seconds...
Does anyone have any idea? Or even better, I'm trying to get logs in datadog to be parsed correctly.Ben Davison
06/09/2020, 11:45 AMPREFECT__LOGGING__FORMAT
just for tasks outputs?Ben Davison
06/09/2020, 11:59 AMPREFECT_SERVER__LOGGING__FORMAT
Ben Davison
06/09/2020, 12:11 PM- name: PREFECT_SERVER__LOGGING__FORMAT
value: "{'level': '%(levelname)s', 'message': '%(message)s'}"
The output is blank:
kubectl --namespace data logs prefect-scheduler-649d8c4cb5-mz2pl -f <aws:default>
^C
edit: deffo escaping issueBen Davison
06/09/2020, 12:22 PM- name: PREFECT_SERVER__LOGGING__FORMAT
value: '{""level"": ""%(levelname)s"", ""message"": ""%(message)s""}'
Will show the logs (with "") I've tried escaping like so:
- name: PREFECT_SERVER__LOGGING__FORMAT
value: '{\""level"\": \""%(levelname)s"\", \""message"\": \""%(message)s"\"}'
Same, and if I only do single " no logs show up atall.Ben Davison
06/09/2020, 1:03 PMZachary Hughes
06/09/2020, 1:06 PMZachary Hughes
06/09/2020, 1:19 PM- name: PREFECT_SERVER__LOGGING__FORMAT
value: "%(level) - %(name) | %(message)"
It looks like there might be a double-quoting issue in the snippets you posted.Ben Davison
06/09/2020, 1:29 PMBen Davison
06/09/2020, 1:31 PMBen Davison
06/09/2020, 2:05 PM%
Doesn't work
value: '{"level": "%(levelname)s"}'
Works (but has the double "" issue)
value: '{"level": ""%(levelname)s"}'
I've tried escaping both the quotes with \
and the %
also. It always seems to double up whatever I put there.Zachary Hughes
06/09/2020, 2:21 PM'{\"level\": \"%(levelname)s\", \"message\": \"%(message)s\""}'
I'm going to poke around for just a bit more, but will open an issue if I don't find a solution in the near future. It seems to be related to parsing for the last key-- will keep you posted.Ben Davison
06/09/2020, 2:25 PMZachary Hughes
06/09/2020, 2:39 PMMarvin
06/09/2020, 2:39 PMZachary Hughes
06/09/2020, 2:40 PM