#### Use two appenders, one to log to console, another to log to a file
log4j.rootCategory=info, stdout, RF
log4j.rootLogger= info, stdout, ASW
#### First appender writes to console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x(%F:%L) - %m%n
#### Second appender writes to a file
log4j.appender.RF=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RF.DatePattern='.'yyyy-MM-dd
log4j.appender.RF.File=C:/jrpapp1/wrk/log/weblog/test/test-log.txt
log4j.appender.RF.layout=org.apache.log4j.PatternLayout
log4j.appender.RF.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x(%F:%L) - %m%n
#### Third appender writes to a file
log4j.appender.ASW=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ASW.DatePattern='.'yyyy-MM-dd
log4j.appender.ASW.File=C:/jrpapp1/wrk/log/weblog/admin/admin-log.txt
log4j.appender.ASW.layout=org.apache.log4j.PatternLayout
log4j.appender.ASW.layout.ConversionPattern=[%d{ISO8601}]%5p%6.6r[%t]%x(%F:%L) - %m%n
import org.apache.log4j.Category;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
public class TestLog4j {
private static Logger log = Logger.getLogger(TestLog4j.class.getName());
private static Category cat = Category.getInstance(TestLog4j.class.getName());
public void testLog(){
log.info("Just testing ASW INFO");
cat.info("Just testing RF INFO");
}
public static void main(String[] args) {
TestLog4j tLog = new TestLog4j();
tLog.testLog();
}
}
javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
at org.apache.struts.taglib.TagUtils.retrieveMessageResources(Ljavax/servlet/jsp/PageContext;Ljava/lang/String;Z)Lorg/apache/struts/util/MessageResources;(TagUtils.java:1175)
at org.apache.struts.taglib.html.JavascriptValidatorTag.createDynamicJavascript(Lorg/apache/struts/config/ModuleConfig;Lorg/apache/commons/validator/ValidatorResources;Ljava/util/Locale;Lorg/apache/commons/validator/Form Ljava/lang/String;(JavascriptValidatorTag.java:433)
at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript()Ljava/lang/String;(JavascriptValidatorTag.java:393)
at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag()I(JavascriptValidatorTag.java:349)
at jsp_servlet._jsp._admin._workbench.__workbench._jspService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(__workbench.java:309)
at weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse V(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl V(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse V(ServletStubImpl.java:348)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse V(RequestDispatcherImpl.java:322)
at org.apache.struts.action.RequestProcessor.doForward(Ljava/lang/String;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(RequestProcessor.java:1063)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(Ljava/lang/String;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(TilesRequestProcessor.java:263)
at org.apache.struts.action.RequestProcessor.processForwardConfig(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/config/ForwardConfig V(RequestProcessor.java:386)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/config/ForwardConfig V(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse V(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse V(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl V(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse V(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6981)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction Ljava/lang/Object;(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction Ljava/lang/Object;(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl V(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread V(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest V(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread V(Unknown Source)