Hi, I wanted to know if there's an option where I ...
# troubleshooting
p
Hi, I wanted to know if there's an option where I can turn off the logs from my tap but not target. I tried some suggestion here but can seem to get it working, tap: tap-jira and target: target-s3
Tried this but not working:
Copy code
loggers:
  singer_sdk:
    level: ERROR
    handlers: [console]
    propogate: yes
  singer_sdk.Tap:
    level: ERROR
    handlers: [console]
    propogate: yes
  singer_sdk.Target:
    level: INFO
    handlers: [console]
    propogate: yes
@edgar_ramirez_mondragon do you have any idea here?
e
Yeah, that logging config is not gonna work for the tap or target since it's only for Meltano's own output. You need to take a look at the SDK logging guide if the tap and target are built on it. You could then in
meltano.yml
, inject a different logging config for each plugin:
Copy code
plugins
  extractors:
  - name: tap-github
    env:
      SINGER_SDK_LOG_CONFIG: logging/sdk_tap.yaml
  loaders:
  - name: target-postgres
    env:
      SINGER_SDK_LOG_CONFIG: logging/sdk_target.yaml
I use a global SDK logging config in my dogfood project: https://github.com/edgarrmondragon/meltano-dogfood/blob/e3a06d676f5367215fc98b6bd3b8bdbc100dd60a/meltano.yml#L6-L7
p
thanks for the reply, I tried doing this, but no success: tap:
Copy code
version: 1
disable_existing_loggers: true
formatters:
  metrics:
    format: "{asctime} {message}"
    style: "{"
handlers:
  metrics:
    class: logging.StreamHandler
    level: WARN
    formatter: metrics
    stream: "<ext://sys.stderr>"
loggers:
  singer_sdk.metrics:
    level: WARN
    handlers: [ metrics ]
    propagate: false
target:
Copy code
version: 1
disable_existing_loggers: true
formatters:
  metrics:
    format: "{asctime} {message}"
    style: "{"
handlers:
  metrics:
    class: logging.StreamHandler
    level: INFO
    formatter: metrics
    stream: "<ext://sys.stderr>"
loggers:
  singer_sdk.metrics:
    level: INFO
    handlers: [ metrics ]
    propagate: false
and then in .env:
Copy code
TAP_SINGER_SDK_LOG_CONFIG='logging/singer_tap_logging.yaml'
TARGET_SINGER_SDK_LOG_CONFIG='logging/singer_target_logging.yaml'
u
The right env var is
SINGER_SDK_LOG_CONFIG
p
hey coming back to this, I tried doing this and was able to do only one type
SINGER_SDK_LOG_CONFIG
even if I gave different path in
env
for tap/target, it always pick the config which appears first.
u
Where did you put
SINGER_SDK_LOG_CONFIG
in
meltano.yml
?
p
right now,
SINGER_SDK_LOG_CONFIG
has the same file but the position is same for these variables.
e
it always pick the config which appears first.
not sure I follow this. You're using a single logging configuration. Is the problem that either the tap or target is not picking up the config, or that they're using the same config?