Main Tutorials

Log4j Tutorial

log4j logo

Apache log4j, a classic logging tool in Java. Below are a series of Log4j 1.2 tutorials :

Log4j Tutorials

References

  1. Log4j 1.2 Official Page
  2. Wikipedia : Log4j

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Pushpak
7 years ago

Hi Guys,

I need help on log4j integration. I have integrated it with my testng automation framework. It is logging the errors which i have handled and logged. But I want to print the stacktrace for the errors like if Assert fails or exceptions like that.

Thanks,
Pushpak

krish
9 years ago

how to get colored logs, I have been trying this for few days but no luck, could you plz.

JTW
8 years ago
Reply to  krish

Log4J will give you flat text output. Colouring is provided by some log viewing tools, not the logging framework.