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.
- Download Apache Log4j.jar and add it to your classpath
- Create Instance of Logger
- Use debug,info,warn,error,fatal methods to log required information