Table of Contents |
---|
Status
Current state: Under Discussion. Accepted
Discussion thread: https://www.mail-archive.com/dev@kafka.apache.org/msg99656.html
...
JIRA:
Jira | ||||||||
---|---|---|---|---|---|---|---|---|
|
Released:
Pull request: https://github.com/apache/kafka/pull/7403
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
...
Get a list of all named loggers
Returns a list of loggers along with their current log levels. Entries are sorted by the logger's name. A named logger is one that is created by either the worker's classes using the LoggerFactory.getLogger
method or is an ancestor denoted by the name of the package it corresponds to. Their levels are set by the log4j
configuration file used by the worker JVM, or by using this API.
Code Block | ||
---|---|---|
| ||
$ curl -Ss http://localhost:8083/admin/loggers | jq [ ... "org.apache.kafka.connect.runtime.WorkerSinkTask": { "level": "INFO" }, "org.apache.kafka.connect.runtime.WorkerSourceTask": { "level": "DEBUG" }, ... ] |
Get the log level of a specific logger
If the name of a logger is specified, only return the level to which that logger is writing messages at. This level may be set by a log4j
configuration file, or by this API. If neither of those sources specified a level, log4j uses the level of an ancestor that was set by one of these means (the root logger's level is used if none of the other ancestor had a level set to it).
Code Block | ||
---|---|---|
| ||
$ curl -Ss http://localhost:8083/admin/loggers/org.apache.kafka.connect.runtime.WorkerSinkTask | jq
{
"level": "INFO"
} |
Even if it is not used by any runtime classes to log any messages, requesting the level of an ancestor package will also return a log level using the above rules.
Code Block | ||
---|---|---|
| ||
$ curl -Ss http://localhost:8083/admin/loggers/org.apache | jq { "level": "INFO", } |
Set the log level of a specific logger
Use PUT to set the level of a logger. The API returns a the list of loggers whose levels were modified.
...