xml - Configure log4j to log filenames without .java filetype -
i log class names (excluding package prefix) methods in following way:
<classname>.<methodname>
currently xml layout
<layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %5p [%t] (%f.%m) - %m%n" /> </layout>
which returns filename includes .java file type.
is there way configure log4j remove .java filename?
if want class name, should consider %c conversion character, described in javadoc patternlayout.
for instance, specify unqualified class name:
<layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d %5p [%t] (%c{1}.%m) - %m%n" /> </layout>
note usage of {1} qualifier, designates first rightmost component of qualified class name.
Comments
Post a Comment