mirror of https://github.com/apache/activemq.git
add trace level log to shared file locker keepAlive
This commit is contained in:
parent
8c4b5f485d
commit
c17b7fdc7f
|
@ -94,7 +94,9 @@ public class SharedFileLocker extends AbstractLocker {
|
|||
|
||||
@Override
|
||||
public boolean keepAlive() {
|
||||
return lockFile != null && lockFile.keepAlive();
|
||||
boolean result = lockFile != null && lockFile.keepAlive();
|
||||
LOG.trace("keepAlive result: " + result + (name != null ? ", name: " + name : ""));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,5 +118,8 @@ public class SharedFileLocker extends AbstractLocker {
|
|||
@Override
|
||||
public void configure(PersistenceAdapter persistenceAdapter) throws IOException {
|
||||
this.setDirectory(persistenceAdapter.getDirectory());
|
||||
if (name == null) {
|
||||
name = getDirectory().toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.apache.activemq.util.IOHelper;
|
|||
import org.apache.activemq.util.LockFile;
|
||||
import org.apache.activemq.util.ServiceStopper;
|
||||
import org.apache.activemq.util.Wait;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.spi.LoggingEvent;
|
||||
import org.junit.Assert;
|
||||
|
@ -88,7 +89,9 @@ public class SharedFileLockerTest {
|
|||
DefaultTestAppender appender = new DefaultTestAppender() {
|
||||
@Override
|
||||
public void doAppend(LoggingEvent event) {
|
||||
logCounts.incrementAndGet();
|
||||
if (event.getLevel() == Level.INFO) {
|
||||
logCounts.incrementAndGet();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue