/** * Read the configuration file <code>configFilename</code> if it exists. Moreover, a thread will * be created that will periodically check if <code>configFilename</code> has been created or * modified. The period is determined by the <code>delay</code> argument. If a change or file * creation is detected, then <code>configFilename</code> is read to configure log4j. * * @param configFilename A file in key=value format. * @param delay The delay in milliseconds to wait between each check. */ public static void configureAndWatch(String configFilename, long delay) { PropertyWatchdog pdog = new PropertyWatchdog(configFilename); pdog.setDelay(delay); pdog.start(); LogManager.getLoggerRepository().addShutdownEventListener(pdog); }
/** * Read the configuration file <code>configFilename</code> if it exists. Moreover, a thread will * be created that will periodically check if <code>configFilename</code> has been created or * modified. The period is determined by the <code>delay</code> argument. If a change or file * creation is detected, then <code>configFilename</code> is read to configure log4j. * * @param configFilename A file in key=value format. * @param delay The delay in milliseconds to wait between each check. */ public static void configureAndWatch(String configFilename, long delay) { PropertyWatchdog pdog = new PropertyWatchdog(configFilename); pdog.setDelay(delay); pdog.start(); }