Original issue 363 created by soi-toolkit on 2014-01-23T20:23:36.000Z:
Problem
The current log4j-pattern:
%d %-5p %-30C - %m%n
outputs the caller name (which is also slow to generate according to docs) instead of the category.
The result is misleading/non-helpful logs regarding where a log was written from.
Example: see that logging seems to come from "org.mule.module.logging.DispatchingLogger"
2014-01-23 20:09:31,644 INFO org.mule.module.logging.DispatchingLogger - Loading XML bean definitions from class path resource [soitoolkit-mule-file-connector.xml]
2014-01-23 20:09:36,213 INFO org.mule.module.logging.DispatchingLogger - soi-toolkit.log
\ logEvent-info.start ***
Proposed solution
Change the pattern to (note: lowercase "c" instead of uppercase "C"):
%d %-5p %-30c - %m%n
Example: see how the "org.mule.module.logging.DispatchingLogger" from the previous example is replaced with meaningful info:
2014-01-23 21:07:16,178 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [soitoolkit-mule-file-connector.xml]
2014-01-23 21:07:21,321 INFO org.soitoolkit.commons.mule.messageLogger - soi-toolkit.log
\ logEvent-info.start ***
Original issue 363 created by soi-toolkit on 2014-01-23T20:23:36.000Z:
Problem
The current log4j-pattern:
%d %-5p %-30C - %m%n
outputs the caller name (which is also slow to generate according to docs) instead of the category. The result is misleading/non-helpful logs regarding where a log was written from.
Example: see that logging seems to come from "org.mule.module.logging.DispatchingLogger"
2014-01-23 20:09:31,644 INFO org.mule.module.logging.DispatchingLogger - Loading XML bean definitions from class path resource [soitoolkit-mule-file-connector.xml] 2014-01-23 20:09:36,213 INFO org.mule.module.logging.DispatchingLogger - soi-toolkit.log \ logEvent-info.start ***
Proposed solution
Change the pattern to (note: lowercase "c" instead of uppercase "C"):
%d %-5p %-30c - %m%n
Example: see how the "org.mule.module.logging.DispatchingLogger" from the previous example is replaced with meaningful info:
2014-01-23 21:07:16,178 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [soitoolkit-mule-file-connector.xml] 2014-01-23 21:07:21,321 INFO org.soitoolkit.commons.mule.messageLogger - soi-toolkit.log \ logEvent-info.start ***
Ref: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html