Skip to content

this is sample program to show how to use log4j for logging in java program

Notifications You must be signed in to change notification settings

DIL8654/Log4J-example-with-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Log4J-example-with-java

this is sample program to show how to use log4j for logging in java program

Sample output from the given program

2017-11-29 19:22:31,580 [main] DEBUG (LoggingHelper.java:19) - This is debug log..
 2017-11-29 19:22:31,581 [main] INFO  (LoggingHelper.java:23) - This is info  log ...
 2017-11-29 19:22:31,581 [main] WARN  (LoggingHelper.java:26) - This is warn log ...
 2017-11-29 19:22:31,581 [main] ERROR (LoggingHelper.java:27) - This is error log... 
 2017-11-29 19:22:31,582 [main] FATAL (LoggingHelper.java:28) - This is fatal log ...
 2017-11-29 19:23:44,026 [main] DEBUG (LoggingHelper.java:19) - This is debug log..
 2017-11-29 19:23:44,028 [main] INFO  (LoggingHelper.java:23) - This is info  log ...
 2017-11-29 19:23:44,028 [main] WARN  (LoggingHelper.java:26) - This is warn log ...
 2017-11-29 19:23:44,028 [main] ERROR (LoggingHelper.java:27) - This is error log... 
 2017-11-29 19:23:44,028 [main] FATAL (LoggingHelper.java:28) - This is fatal log ...
 2017-11-29 19:25:15,181 [main] ERROR (LogginHelperOps.java:15) - Sorry, something wrong in your calculation!
 java.lang.ArithmeticException: / by zero
   at com.itos.LogginHelperOps.divide(LogginHelperOps.java:23)
   at com.itos.LogginHelperOps.main(LogginHelperOps.java:13)

About

this is sample program to show how to use log4j for logging in java program

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages