Showing posts with label Log4j. Show all posts
Showing posts with label Log4j. Show all posts

Friday, August 28, 2009

Writing Logs to a Console and File using Log4j

Links to this post
While doing application development it's require you to write logs into File or print logs into Console with expected Date/Time, ProgramName with line number and many more information.

  1. Download Apache Log4j.jar and add it to your classpath
  2. Create Instance of Logger
  3. Use debug,info,warn,error,fatal methods to log required information