diff --git a/conf/log4j.properties b/conf/log4j.properties index dd306991f77..816a12b3e3f 100644 --- a/conf/log4j.properties +++ b/conf/log4j.properties @@ -24,7 +24,7 @@ log4j.appender.RFA.MaxBackupIndex=${smart.log.maxbackupindex} log4j.appender.RFA.layout=org.apache.log4j.PatternLayout # Pattern format: Date LogLevel LoggerName LogMessage -log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n +log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %p %c.%M %L: %m%n # Debugging Pattern format #log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n diff --git a/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyEventApplier.java b/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyEventApplier.java index afab6817ac3..3042fbcd21a 100644 --- a/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyEventApplier.java +++ b/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyEventApplier.java @@ -69,18 +69,29 @@ public void apply(Event[] events) throws IOException, MetaStoreException { private List getSqlStatement(Event event) throws IOException, MetaStoreException { switch (event.getEventType()) { case CREATE: + LOG.trace("event type:" + event.getEventType().name() + + ", path:" + ((Event.CreateEvent)event).getPath()); return Arrays.asList(this.getCreateSql((Event.CreateEvent)event)); case CLOSE: + LOG.trace("event type:" + event.getEventType().name() + + ", path:" + ((Event.CloseEvent)event).getPath()); return Arrays.asList(this.getCloseSql((Event.CloseEvent)event)); -// case TRUNCATE: -// return this.getTruncateSql((Event.TruncateEvent)event); case RENAME: + LOG.trace("event type:" + event.getEventType().name() + + ", src path:" + ((Event.RenameEvent)event).getSrcPath() + + ", dest path:" + ((Event.RenameEvent)event).getDstPath()); return this.getRenameSql((Event.RenameEvent)event); case METADATA: + LOG.trace("event type:" + event.getEventType().name() + + ", path:" + ((Event.MetadataUpdateEvent)event).getPath()); return Arrays.asList(this.getMetaDataUpdateSql((Event.MetadataUpdateEvent)event)); case APPEND: + LOG.trace("event type:" + event.getEventType().name() + + ", path:" + ((Event.AppendEvent)event).getPath()); return this.getAppendSql((Event.AppendEvent)event); case UNLINK: + LOG.trace("event type:" + event.getEventType().name() + + ", path:" + ((Event.UnlinkEvent)event).getPath()); return this.getUnlinkSql((Event.UnlinkEvent)event); } return Arrays.asList(); diff --git a/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyFetchAndApplyTask.java b/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyFetchAndApplyTask.java index 05985cbcb93..efaf47c41b2 100644 --- a/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyFetchAndApplyTask.java +++ b/smart-hdfs/src/main/java/org/smartdata/hdfs/metric/fetcher/InotifyFetchAndApplyTask.java @@ -26,6 +26,7 @@ import org.smartdata.metastore.MetaStoreException; import java.io.IOException; +import java.util.Date; import java.util.concurrent.atomic.AtomicLong; public class InotifyFetchAndApplyTask implements Runnable { @@ -44,6 +45,7 @@ public InotifyFetchAndApplyTask(DFSClient client, InotifyEventApplier applier, l @Override public void run() { + LOG.trace("InotifyFetchAndApplyTask run at " + new Date()); try { EventBatch eventBatch = inotifyEventInputStream.poll(); while (eventBatch != null) { diff --git a/smart-metrics/src/main/java/org/smartdata/metrics/impl/SmartServerAccessEventSource.java b/smart-metrics/src/main/java/org/smartdata/metrics/impl/SmartServerAccessEventSource.java index 66eccd8cb51..88499fce72c 100644 --- a/smart-metrics/src/main/java/org/smartdata/metrics/impl/SmartServerAccessEventSource.java +++ b/smart-metrics/src/main/java/org/smartdata/metrics/impl/SmartServerAccessEventSource.java @@ -51,6 +51,7 @@ public FileAccessEventCollector getCollector() { public void insertEventFromSmartClient(FileAccessEvent event) { try { this.eventQueue.put(event); + LOG.trace("Access:" + event.getPath()); } catch (InterruptedException e) { LOG.error("Event queue enqueue path={} error", event.getPath(), e); }