Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not getting Line Numbers while logging with Log4j

 
Devesh Chanchlani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem description: Getting "?" in place of line numbers, while logging with log4j. All other parameters are working. The details are given below:

Log4j.properties


Test.java


OUTOUT
[java] 2009-03-02 03:39:48 [ Test , main , ? ] DEBUG => LOGGER WORKING !!!


Thanks in Advance.
 
Devesh Chanchlani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved the issue, just needed to change the ant script in the following manner:

<target name="compile" depends="prepare" description="Normal build of application">
<javac srcdir="src" destdir="${build.dir}" debug="on" debuglevel="lines,vars,source">
<classpath refid="compile.classpath"/>
</javac>
</target>
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct, line numbers will only be displayed when the code is compiled with the debug information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic