Change log level for logstash-jdbc-input plugin

Hi, how to access Log4j2 configuration for logstash-jdbc-input? I want to do the same as

logger.elasticsearchoutput.level = debug

but for logstash-jdbc-input plugin. What is the logger name for this plugin?

Do this while your LS is running - curl -XGET 'localhost:9600/_node/logging?pretty'. You will see the name of the logger used by the jdbc input - add that name to log4j config along with the desired level.

Thank you for the advice! I'm running logstash inside a docker contaner, when doing curl -XGET 'localhost:9600/_node/logging?pretty I see

"loggers" : {
    "logstash.agent" : "INFO",
    "logstash.api.service" : "INFO",
    "logstash.codecs.plain" : "INFO",
    "logstash.codecs.rubydebug" : "INFO",
    "logstash.config.source.local.configpathloader" : "INFO",
    "logstash.config.source.multilocal" : "INFO",
    "logstash.config.sourceloader" : "INFO",
    "logstash.filters.environment" : "INFO",
    "logstash.filters.mutate" : "INFO",
    "logstash.inputs.jdbc" : "INFO",
    "logstash.instrument.periodicpoller.cgroup" : "INFO",
    "logstash.instrument.periodicpoller.deadletterqueue" : "INFO",
    "logstash.instrument.periodicpoller.jvm" : "INFO",
    "logstash.instrument.periodicpoller.os" : "INFO",
    "logstash.instrument.periodicpoller.persistentqueue" : "INFO",
    "logstash.modules.scaffold" : "INFO",
    "logstash.outputs.elasticsearch" : "INFO",
    "logstash.outputs.stdout" : "INFO",
    "logstash.pipeline" : "INFO",
    "logstash.plugins.registry" : "INFO",
    "logstash.runner" : "INFO",
    "logstash.setting.writabledirectory" : "INFO",
    "org.logstash.Event" : "INFO",
    "org.logstash.Logstash" : "INFO",
    "org.logstash.common.DeadLetterQueueFactory" : "INFO",
    "org.logstash.common.io.DeadLetterQueueWriter" : "INFO",
    "org.logstash.config.ir.CompiledPipeline" : "INFO",
    "org.logstash.instrument.metrics.gauge.LazyDelegatingGauge" : "INFO",
    "org.logstash.secret.store.SecretStoreFactory" : "INFO",
    "org.logstash.secret.store.backend.JavaKeyStore" : "INFO",
    "slowlog.logstash.codecs.plain" : "INFO",
    "slowlog.logstash.codecs.rubydebug" : "INFO",
    "slowlog.logstash.filters.environment" : "INFO",
    "slowlog.logstash.filters.mutate" : "INFO",
    "slowlog.logstash.inputs.jdbc" : "INFO",
    "slowlog.logstash.outputs.elasticsearch" : "INFO",
    "slowlog.logstash.outputs.stdout" : "INFO"
  }

but when I do RUN echo "loggers.logstash.inputs.jdbc.level = warn" >> /usr/share/logstash/config/log4j2.properties inside a container to change the logging level I don't get any change, it's still "logstash.inputs.jdbc" : "INFO". In the example on https://www.elastic.co/guide/en/logstash/current/logging.html I see logger.elasticsearchoutput.level = debug though I don't see it in that format (elasticsearchoutput) anywhere, so where to take this value from?

In this text:

logger.elasticsearchoutput.name = logstash.outputs.elasticsearch
logger.elasticsearchoutput.level = debug

logger.elasticsearchoutput is a namespace, it is your choice.

logger.covfefe.name = logstash.inputs.jdbc
logger.covfefe.level = WARN

but

logger.jdbcinput.name = logstash.inputs.jdbc
logger.jdbcinput.level = WARN

is probably better. :smile:. Try both

Thanks for the help!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.