Slowlog logging when threshold set to 0, regardless of log level


#1

I'm running Elasticsearch 2.1.0 and have logging set to INFO in logging.yml:

es.logger.level: INFO
index.search.slowlog: INFO, index_search_slow_log_file
index.indexing.slowlog: INFO, index_indexing_slow_log_file

In elasticsearch.yml I have the following set:

index.search.slowlog.threshold.query.warn: 3s
index.search.slowlog.threshold.query.info: 2s
index.search.slowlog.threshold.query.debug: 1s
index.search.slowlog.threshold.query.trace: 0

index.search.slowlog.threshold.fetch.warn: 500ms
index.search.slowlog.threshold.fetch.info: 250ms
index.search.slowlog.threshold.fetch.debug: 100ms
index.search.slowlog.threshold.fetch.trace: 0

index.indexing.slowlog.threshold.index.warn: 1s
index.indexing.slowlog.threshold.index.info: 500s
index.indexing.slowlog.threshold.index.debug: 250ms
index.indexing.slowlog.threshold.index.trace: 0

The numbers don't really matter as I'm still playing around with the values. What's important is with the trace threshold set to 0, TRACE logs will still be sent to the log file, event though the log level is set to INFO. If I increase all the trace values to 100ms and restart ES, then nothing is logged as expected.

The same happens if I set the debug threshold to 0.

Is this a bug? Can anyone replicate this?


(Vincent Tran) #2

What exactly are you trying to do by setting the threshold to 0? If you are trying to turn off that particular log level, set it to -1.


#3

Our intent is to use the slowlog to capture all activity into a separate index and view some of the information for analysis. Obviously we wouldn't set it to TRACE and leave it on, but in our lower environments we would like to change the transient log level settings so we can selectively toggle the log level between TRACE and INFO or any of the other thresholds we have set.


(system) #4