I am using log4j for logging in my Java project. My conversion pattern is as below.
ConversionPattern=%d{MMMMM dd,yyyy HH:mm:ss} %-5p [ %C{1} - %M() - %L ] - %m%n
Now for all Java classes, it prints output as:
February 03,2012 15:18:41 DEBUG [ RadiusClientConfigBean - initialize() - 63 ] - RadiusClientsConfigBean.initialize() Called
But for JSP pages it prints as:
February 03,2012 15:19:00 DEBUG [ managevoippolicy_jsp - _jspService() - 443 ] - VoIP Policies = 4
which is not the actual line number of that JSP page. How can I print line numbers for JSP pages.
A way to determine the original line number from a JSP would be JSR-45 Debugging Support for Other Languages The JSP compiler creates a SourceMap (SMAP) which you could use. (I wouldn’t recommend this for production).
AS a starting point this discussion might be helpful:
http://tomcat.10.n6.nabble.com/Read-JSR-045-SMAP-Files-Produced-by-Jasper-td2128534.html