You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by mw...@apache.org on 2006/02/16 06:37:18 UTC
svn commit: r378167 -
/logging/log4j/trunk/src/java/org/apache/log4j/watchdog/TimedLocationWatchdog.java
Author: mwomack
Date: Wed Feb 15 21:37:16 2006
New Revision: 378167
URL: http://svn.apache.org/viewcvs?rev=378167&view=rev
Log:
Added more debug statements
Modified:
logging/log4j/trunk/src/java/org/apache/log4j/watchdog/TimedLocationWatchdog.java
Modified: logging/log4j/trunk/src/java/org/apache/log4j/watchdog/TimedLocationWatchdog.java
URL: http://svn.apache.org/viewcvs/logging/log4j/trunk/src/java/org/apache/log4j/watchdog/TimedLocationWatchdog.java?rev=378167&r1=378166&r2=378167&view=diff
==============================================================================
--- logging/log4j/trunk/src/java/org/apache/log4j/watchdog/TimedLocationWatchdog.java (original)
+++ logging/log4j/trunk/src/java/org/apache/log4j/watchdog/TimedLocationWatchdog.java Wed Feb 15 21:37:16 2006
@@ -56,6 +56,15 @@
}
/**
+ * Returns the last modification time.
+ *
+ * @return the last modification time
+ */
+ public long getLastModificationTime() {
+ return lastModTime;
+ }
+
+ /**
* Returns the current modification time for the watched location. Subclasses
* must implement specifically for the type of source they are watching.
*
@@ -71,11 +80,17 @@
* watched source for the configuration data.
*/
public void execute() {
- long newModTime = getModificationTime();
+ long curModTime = getModificationTime();
- if (lastModTime != newModTime) {
+ getLogger().debug("Checking times for watchdog " + this.getName() +
+ " :(lastModTime - " + lastModTime + ") ?? (curModTime - " + curModTime + ")");
+ if (lastModTime != curModTime) {
+ getLogger().debug("Times did not match, reconfiguring with watchdog " +
+ this.getName());
reconfigure();
- lastModTime = newModTime;
+ lastModTime = curModTime;
+ } else {
+ getLogger().debug("Times matched, doing nothing");
}
}
@@ -83,6 +98,8 @@
* Called to activate the watchdog and start the watching of the source.
*/
public void activateOptions() {
+ getLogger().debug("activateOptions called for watchdog " + this.getName());
+
// get the current modification time of the watched source
lastModTime = getModificationTime();
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org