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

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Pushpak
10 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
11 years ago

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

JTW
11 years ago
Reply to  krish

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