This binds to the Log4j 2 API and does not require a specific implementation of the Log4j 2 API.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearMdc()
Implements org. Removes all entries from the message diagnostics context. |
| public void | clearNdc()
Implements org. Clears the nested diagnostics context. |
| public Log4j2Logger | getLogger(String
the name of the logger name)Implements org. Returns a logger which is backed by a logger from the log provider. |
| public Object | getMdc(String
the key to lookup the value for key)Implements org. Returns the value for the key on the message diagnostics context or |
| public Map | |
| public String | getNdc()
Implements org. Retrieves the current values set for the nested diagnostics context. |
| public int | getNdcDepth()
Implements org. The current depth of the nested diagnostics context. |
| public String | peekNdc()
Implements org. Peeks at the top value from the stack and returns it. |
| public String | popNdc()
Implements org. Pops top value from the stack and returns it. |
| public void | pushNdc(String
the message to push message)Implements org. Pushes a value to the nested diagnostics context stack. |
| public Object | putMdc(String
the key for the value key, Object the value value)Implements org. Puts the value onto the message diagnostics context. |
| public void | removeMdc(String
the key of the value to remove key)Implements org. Removes the value from the message diagnostics context. |
| public void | setNdcMaxDepth(int
the maximum depth to set maxDepth)Implements org. Sets maximum depth of the stack removing any entries below the maximum depth. |
| Log4j2LoggerProvider | back to summary |
|---|---|
| public Log4j2LoggerProvider() | |
| clearMdc | back to summary |
|---|---|
| public void clearMdc() Implements org. Doc from org. Removes all entries from the message diagnostics context.
| |
| clearNdc | back to summary |
|---|---|
| public void clearNdc() Implements org. Doc from org. Clears the nested diagnostics context.
| |
| getLogger | back to summary |
|---|---|
| public Log4j2Logger getLogger(String name) Implements org. Doc from org. Returns a logger which is backed by a logger from the log provider. Note this should never be
| |
| getMdc | back to summary |
|---|---|
| public Object getMdc(String key) Implements org. Doc from org. Returns the value for the key on the message diagnostics context or | |
| getMdcMap | back to summary |
|---|---|
| public Map Implements org. Doc from org. Returns the map from the context. Note that in most implementations this is an expensive operation and should be used sparingly. | |
| getNdc | back to summary |
|---|---|
| public String getNdc() Implements org. Doc from org. Retrieves the current values set for the nested diagnostics context. | |
| getNdcDepth | back to summary |
|---|---|
| public int getNdcDepth() Implements org. Doc from org. The current depth of the nested diagnostics context.
| |
| peekNdc | back to summary |
|---|---|
| public String peekNdc() Implements org. Doc from org. Peeks at the top value from the stack and returns it. | |
| popNdc | back to summary |
|---|---|
| public String popNdc() Implements org. Doc from org. Pops top value from the stack and returns it. | |
| pushNdc | back to summary |
|---|---|
| public void pushNdc(String message) Implements org. Doc from org. Pushes a value to the nested diagnostics context stack. | |
| putMdc | back to summary |
|---|---|
| public Object putMdc(String key, Object value) Implements org. Doc from org. Puts the value onto the message diagnostics context. | |
| removeMdc | back to summary |
|---|---|
| public void removeMdc(String key) Implements org. Doc from org. Removes the value from the message diagnostics context. | |
| setNdcMaxDepth | back to summary |
|---|---|
| public void setNdcMaxDepth(int maxDepth) Implements org. Doc from org. Sets maximum depth of the stack removing any entries below the maximum depth.
| |