2013-10-22 27 views

回答

1

在一個多線程的機器,你應該使用線程ID /線程名稱的跟蹤日誌。

從log4j的文檔,

For example, the PatternLayout with the conversion pattern "%r [%t] %-5p %c - %m%n" 
will output something akin to: 

176 [main] INFO org.foo.Bar - Located nearest gas station. 

閱讀here如果你需要轉換模式的更多想法。