Log4j Tutorial
Apache log4j, a classic logging tool in Java. Below are a series of Log4j 1.2 tutorials :
Log4j Tutorials
-
Log4j hello world example
A simple Log4j hello world example, a quick start guide. -
log4j.properties Example
Log4j configuration in properties file format. -
log4j.xml example
Log4j configuration in XML file format. -
Spring MVC + Log4j integration example
Enable log4j logging in Spring MVC framework. -
Struts 2 + Log4j Integration Example
Enable log4j logging in Struts 2 framework. -
Struts 1 + Log4j integration example
Enable log4j logging in Struts 1 framework. -
JSF 2 + Log4j Integration Example
Enable log4j logging in JSF 2 framework. Example to use slf4j bridge handler, to redirect logging from java.util.logging to log4j. -
Wicket + Log4j Integration Example
Enable log4j logging in Wicket framework. Wicket uses slf4j, need slf4j-log4j12
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
how to get colored logs, I have been trying this for few days but no luck, could you plz.
Log4J will give you flat text output. Colouring is provided by some log viewing tools, not the logging framework.