Skip to content

Instantly share code, notes, and snippets.

@sirianni
Created January 29, 2022 14:43
Show Gist options
  • Save sirianni/1540d9b57bbf248ed885d55660a24a04 to your computer and use it in GitHub Desktop.
Save sirianni/1540d9b57bbf248ed885d55660a24a04 to your computer and use it in GitHub Desktop.
Set log4j levels via Jolokia
$ http ':7777/jolokia/write/org.apache.logging.log4j2:component=Loggers,name=io.opentelemetry,type=251a69d7/Level/INFO'
HTTP/1.1 200 OK

{
    "request": {
        "attribute": "Level",
        "mbean": "org.apache.logging.log4j2:component=Loggers,name=io.opentelemetry,type=251a69d7",
        "type": "write",
        "value": "INFO"
    },
    "status": 200,
    "timestamp": 1643467316,
    "value": "TRACE"
}
$ http ':7777/jolokia/read/org.apache.logging.log4j2:component=Loggers,name=io.opentelemetry,type=251a69d7/Level'      
HTTP/1.1 200 OK

{
    "request": {
        "attribute": "Level",
        "mbean": "org.apache.logging.log4j2:component=Loggers,name=io.opentelemetry,type=251a69d7",
        "type": "read"
    },
    "status": 200,
    "timestamp": 1643467330,
    "value": "INFO"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment