I have Custom logger Class mycust.log.LoggerLog4j.java
, whenever I want to log any message I will use like Log.info("Some Message")
. Say I am writing this line in com/TestLog.java
at line 10
in method printLogTest()
.
Current Log:
2013-10-30 16:32:50,528 INFO [main] [45:mycust.log.LoggerLog4j.java][log] - Some Message
Expected Log:
2013-10-30 16:32:50,528 INFO [main] [10:com.TestLog.java][printLogTest] - Some Message
Log4j.properties entry:
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %-5p [%t] [%L:%C.%F][%M] - %m%n
Log4j version :
`log4j-1.2.14.jar`
LoggerLog4j.java:
private static void log(Priority p, Object o, Throwable t) {
try {
Logger logger = org.apache.log4j.Logger.getLogger(this.className);
logger.log(p, o, t);
} catch (Exception e) {
// Logged to sys to avoid infinite cycle
e.printStackTrace();
}
}