Meltano Logging Config: Can I just print the `eve...
# troubleshooting
v
Meltano Logging Config: Can I just print the
event
portion of
message
. I know I can post parse stderr through
jq
and get something similar, but I want to get Meltano to output this in the format I like. Current message
Copy code
[INFO] {'consumer': False, 'producer': True, 'string_id': 'tap-growbots', 'cmd_type': 'elb', 'run_id': '1fc1166c-0796-4f3e-89c2-43a401a204c5', 'job_name': 'test:tap-growbots-to-target-postgres', 'stdio': 'stderr', 'name': 'tap-growbots', 'event': '2024-12-05 10:32:39,684 | INFO     | tap-growbots.campaign | Tap has custom mapper. Using 1 provided map(s).', 'level': 'info', 'timestamp': '2024-12-05T15:32:39.684881Z'}
What I want as the output
Copy code
[INFO] 2024-12-05 10:32:39,684 | INFO     | tap-growbots.campaign | Tap has custom mapper. Using 1 provided map(s).
Current Logging.yaml
Copy code
version: 1
disable_existing_loggers: false

formatters:
  default: # use a format similar to default generic python logging format
    format: "[%(levelname)s] %(message)s"

handlers:
  console: # log to the console (stderr) using structured_colored formatter, logging everything at DEBUG level and up
    class: logging.StreamHandler
    level: DEBUG
    formatter: default
    stream: "<ext://sys.stderr>"

root:
  level:  INFO # the root logger must always specify a level
  propagate: yes # propagate to child loggers
  handlers: [console] # by default use these three handlers
I know that I can play with the
event
itself using the specific tap/target loggers but I don't want to mess with that part of the log right now. Tried diving on this but I'm at my giveup moment as the value just isn't worth it here but I thought I'd ask. Is my only option here a custom formatter?
Forgot to include that this output message comes when I'm running
meltano run tap-growbots target-postgres
e
I don't think we support it at the moment, but might be worth trying out something like https://github.com/hynek/structlog/issues/196
v
What's the reason for the dictionary being put in the
message
, must be a structlog thing? I'm sure I'm missing something, I'll dive more thank you @Edgar Ramírez (Arch.dev)
e
It is indeed structlog's fault. Hard to untangle that without doing something similar to the issue I linked, but we can still just get the
event
key as in the draft PR.
v
Really appreciate the PR here Edgar, I don't thank you enough 😄