hai
still I am not getting output, can anyone help me, Please....
I have initialized log in my ActionServlet and also placed my log4j.properties and log4j.xml files under /WEB-INF/classes
--here is my code--
public class DemoAction extends Action
{
private Log log=LogFactory.getLog("DemoAction");
public ActionForward execute(ActionMapping mapping,Actionform form,...........)
{
.................
..............
..................
if(username==null&&password==null)
{
log.error("User has not Logged In");
}
else
log.error("User has LoggedIn in session");
}
return mapping.findForward("success");
}
}
here is my log4j.properties
log4j.rootLogger="ERROR",Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%5p]%d{mm:ss}(%F:%M:%L)%n%m%n%n
here is my log4j.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:Configuration SYSTEM "log4j.dtd">
<log4j:Configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout"/>
</appender>
<root>
<priority value="debug"/>
<appender-ref ref=ConsoleAppender"/>
</root>
</log4j:Configuration>
I have log4j-1.2.9.jar under /common/WEB-INF/lib and also under my /WEB-INF/lib.
Can anyone tell me where is my mistake,
and tell me what are all the changes i have to do,please................
Thanks in advance..........