暂时解决异常打印不出来情况

原创
2013/07/08 15:41
阅读数 380

  项目是java的SSI框架。

   发现异常log4j没有打印出来。控制台也没有。

   后来配置在struts.xml中:

<global-exception-mappings>
           <exception-mapping  result="exception" exception="java.lang.Exception" />
       </global-exception-mappings>

  <global-results>
			<result name="loginError">
				/front/login/front_login.jsp
			</result>
			<result name="loginErrorBack">
				/back/login/backlogin_s.jsp
			</result>
          	<result name="exception" >
          		/common/error/error.jsp
          	</result>
</global-results>

 

error.jsp:

LogUtil.logThrow.error("系统异常>>>"+new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date())+">>>"+request.getAttribute("exception")+request.getAttribute("exceptionStack"));

本来想用spring AOP拦截日志,后来居然发现没有起效果。应该是配置有问题。先mark一下。

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部