Hi Folks,
I have to print the error with line and error name using log4j property file so what property should i put in log4j property file so i will print error with line numbers!


Regards,
Rajeshwar.

Most of the log calls allow you to print a message and the caught exception. Try this:

try
{
  // do something
} catch ( Exception e )
{
  if ( log.isDebugEnabled() )
  {
    log.debug( "Exception throw.", e );
  }
}

This will log the message and the stack trace (including line numbers) for the caught exception. There are similar methods for info, warn and error.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.