Matt Menzenski
03/21/2024, 12:47 PMlogging.yaml
(taken mostly from the docs). I also have MELTANO_CLI_LOG_CONFIG=logging.yaml
set in my job’s environment variables.
version: 1
disable_existing_loggers: false
formatters:
json:
(): meltano.core.logging.json_formatter
handlers:
console:
class: logging.StreamHandler
formatter: json
stream: <ext://sys.stdout>
root:
level: INFO
propagate: 'yes'
handlers:
- console
loggers:
tap_mongodb:
level: DEBUG
propagate: false
handlers:
- console
snowflake.connector.cursor:
level: WARNING
propagate: false
handlers:
- console
I’m getting log messages that look like this (I have un-minified this):
{
"consumer": true,
"producer": false,
"string_id": "target-snowflake-my-stream-name",
"cmd_type": "elb",
"stdio": "stderr",
"name": "target-snowflake-my-stream-name",
"event": "2024-03-21 12:37:12,535 | INFO | snowflake.connector.cursor | query execution done",
"level": "info",
"timestamp": "2024-03-21T12:37:12.538133Z"
}
Note how event
there is a formatted string. I want to have those fields as a structured object instead. Something like this would be ideal:
{
"consumer": true,
"producer": false,
"string_id": "target-snowflake-my-stream-name",
"cmd_type": "elb",
"stdio": "stderr",
"name": "target-snowflake-my-stream-name",
"event": {
"timestamp": "2024-03-21 12:37:12,535",
"level": "INFO",
"logger": "snowflake.connector.cursor",
"message": "query execution done"
},
"level": "info",
"timestamp": "2024-03-21T12:37:12.538133Z"
}
Is that possible to do via logging configuration?visch
03/21/2024, 1:17 PMvisch
03/21/2024, 1:19 PMEdgar Ramírez (Arch.dev)
03/21/2024, 2:09 PM