Posted By:
prachi_jain
Posted On:
Thursday, October 3, 2002 07:17 AM
Test Hiii All, First of all, i m happy to see the forum for Log4j. Thanks. I am trying to use Log4j with jsps. I am using the log taglib from jakarta along with Log4j. I wants to do the logging for any kind of exceptions also. I tried to use the log tags in expection. But, it didn't work. Here is what i m using. What can be the problem with this. Moreover, i have kept my Log4j.properties in my java classes path. <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %> <%@ page session = "false"%> <% try{ }catch(Exception ex){ %>
More>>
Test
Hiii All,
First of all, i m happy to see the forum for Log4j. Thanks.
I am trying to use Log4j with jsps. I am using the log taglib from jakarta along with Log4j.
I wants to do the logging for any kind of exceptions also. I tried to use the log tags in expection. But, it didn't work.
Here is what i m using. What can be the problem with this. Moreover, i have kept my Log4j.properties in my java classes path.
<%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
<%@ page session = "false"%>
<%
try{
}catch(Exception ex){
%>
<% ex.getMessage();%>
<%
}
%>
I have one more doubt?? How you are initialising Log4j while using with jsps. I tried to keep the Log4j.properties in myapp/web-inf/classes. But, i think that's not worked up.
In log4j properties i have set the level to info.
Let me tell you, where i have placed the files.If suppose test is my app. then,
I have placed the log.tld in
webapps estWEB-INFjsplog.tld
I have placed the jar files in
webapps estWEB-INFliblog.jar
I am getting the output in console and in file. But, i m not getting the exception info in file.
I am using TestLogging.java file for initialising log4j.
The following is the content of properties file:
# Sample properties to initialise log4j
log4j.rootCategory=info, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:\jakarta-tomcat-3.2.2\webapps\test\logtags.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=2
log4j.appender.R.layout=org.apache.log4j.PatternLayout
Please guide me to solve out this problem.
regards