<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="chsdate" downloadurl=""/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
/* Page Definitions */
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1 style='layout-grid:15.6pt'>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>Hi:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'> <o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'> After
moved a web application from Tomcat to JBoss, I found that in DEBUG model there
was some problem with the Log4j’s conversion character ‘L’. here
are the details:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;font-weight:bold'>JBoss version: </span></font></b><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>jboss-<st1:chsdate
IsROCDate="False" IsLunarDate="False" Day="30" Month="12" Year="1899" w:st="on">4.0.4</st1:chsdate>.GA<o:p></o:p></span></font></p>
<p class=MsoNormal><b><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;font-weight:bold'>The application’s
Log4j.xml: <o:p></o:p></span></font></b></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'> …<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'> <param
name="ConversionPattern" value="%d{dd/MM/yyyy HH:mm:ss} %-2p
%c:%L - %m%n"/><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'> …<o:p></o:p></span></font></p>
<p class=MsoNormal><b><font size=1 face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;font-weight:bold'>Code for logging:<o:p></o:p></span></font></b></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'> …<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'> </span></font><b><font
size=2 color="#7f0055" face="Courier New"><span lang=EN-US style='font-size:
10.0pt;font-family:"Courier New";color:#7F0055;font-weight:bold'>import</span></font></b><font
size=2 color=black face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New";color:black'> org.apache.commons.logging.Log;</span></font><font
size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;font-family:
"Courier New"'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:42.0pt;text-indent:21.0pt'><b><font
size=2 color="#7f0055" face="Courier New"><span lang=EN-US style='font-size:
10.0pt;font-family:"Courier New";color:#7F0055;font-weight:bold'>import</span></font></b><font
size=2 color=black face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New";color:black'> org.apache.commons.logging.LogFactory;<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:42.0pt;text-indent:21.0pt'><font size=1
face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:42.0pt;text-indent:21.0pt'><font size=1
face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>private static
Log _log = LogFactory.getLog(SampleClass.class.getName());<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:42.0pt;text-indent:21.0pt'><font size=1
face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>…<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:42.0pt;text-indent:21.0pt'><font size=1
face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:Arial'>_log.debug(“Log4j
log a DEBUG message”);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>Then in Tomcat, I can got:</span></font><span
lang=EN-US> </span><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>10:17:57,359 DEBUG SampleClass:<b><font color=red><span
style='color:red;font-weight:bold'>18</span></font></b> - Log4j log a DEBUG
message ()<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>In JBoss it turned to: 10:17:57,359 DEBUG SampleClass:<b><font
color=red><span style='color:red;font-weight:bold'> 84</span></font></b> -
Log4j log a DEBUG message ()<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>How could the Line NO. turned from 18 to 84, and how to
fix this problem? We need the line NO. to debug this software system.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>I’ll be very grateful if someone could give me some
help, my captain have order me to go through the JBoss’ source code to find
out the answer, but it terrible for me to do like he said.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=black face="Times New Roman"><span
lang=EN-US style='font-size:10.5pt;color:black'>Best Regards<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>Adam<o:p></o:p></span></font></p>
</div>
</body>
</html>