Skip to content

Instantly share code, notes, and snippets.

@mingliangguo
Created December 2, 2019 00:05
Show Gist options
  • Save mingliangguo/efbfab971bec2de2aa41c28904a24329 to your computer and use it in GitHub Desktop.
Save mingliangguo/efbfab971bec2de2aa41c28904a24329 to your computer and use it in GitHub Desktop.
lo4j2 configuration

log4j2 configuration

Configuration automatic reload

When configured from a File, Log4j has the ability to automatically detect changes to the configuration file and reconfigure itself. If the monitorInterval attribute is specified on the configuration element and is set to a non-zero value then the file will be checked the next time a log event is evaluated and/or logged and the monitorInterval has elapsed since the last check. The example below shows how to configure the attribute so that the configuration file will be checked for changes only after at least 30 seconds have elapsed. The minimum interval is 5 seconds.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="30">
...
</Configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment