web.xml中配置log4j
1.将 commons-logging.jar和 log4j.jar加入你的项目中;
2.在src/下创建log4j.properties|log4j.xml文件;
3.在web.xml中配置log4j的信息,如下:
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
注意:红色代码是固定的,log4jConfigLocation就是用来加载log4j文件的固定名。
web.xml中配置log4j的更多相关文章
- 在web.xml中配置error-page
在web.xml中配置error-page 在web.xml中有两种配置error-page的方法,一是通过错误码来配置,而是通过异常的类型来配置,分别举例如下: 一. 通过错误码来配置error ...
- web.xml中配置Spring中applicationContext.xml的方式
2011-11-08 16:29 web.xml中配置Spring中applicationContext.xml的方式 使用web.xml方式加载Spring时,获取Spring applicatio ...
- web.xml 中配置了error-page但不起作用问题
问题: 在web.xml 中配置了 error-page,但是好像不起作用,就是跳转不到指定的页面. 配置信息如下: <!-- 400错误 --> <error-page> & ...
- struts2 在 Action 或 Interceptor 中获取 web.xml 中配置的 <context-param> 参数 (这是我的第一篇博文,哈哈。)
最近为了改一个问题,想加一个控制开关,就在web.xml 中配置了一个 <context-param> 参数,并在 Action 或 Interceptor 中获取参数值. 1.在 web ...
- 在web.xml中配置监听器来控制ioc容器生命周期
5.整合关键-在web.xml中配置监听器来控制ioc容器生命周期 原因: 1.配置的组件太多,需保障单实例 2.项目停止后,ioc容器也需要关掉,降低对内存资源的占用. 项目启动创建容器,项目停止销 ...
- 在哪个web.xml中配置welcome页面
是在tomcat的web.xml中配置,而不是在你的%web-project-root%/WEB-INF/web.xml中! 示例 <welcome-file-list> <welc ...
- 在web.xml中配置SpringMVC
代码如下 <servlet> <servlet-name>springMVC</servlet-name> <servlet-class>org.spr ...
- web.xml中配置启动时加载的servlet,load-on-starup
web.xml中配置启动时加载的servlet,load-on-starup 使用servlet来初始化配置文件数据: 在servlet的配置当中,<load-on-startup>1&l ...
- web.xml中配置固定数据
在web.xml单个servlet中配置的数据的存取 存: <servlet> <description>This is the description of my J2EE ...
随机推荐
- sql 字段先计算后再拿比对的字段进行比对 效率提升100倍
关于日期索引的使用,不要计算后再对比,否则使用不了索引例如:以下执行不了索引,耗时很大 dywl=# explain analyze SELECT car_bill.billno,car_bill.b ...
- The Lead Game Add problem to Todo list Problem code: TLG
'''def count_lead(first, second): if first > second: return 1, first - second elif first == secon ...
- Javascript个人理解
一. 生成对象的原始模式 假定我们把猫看成一个对象,它有"名字"和"颜色"两个属性. var Cat = { name : '', color : '' } 现 ...
- [HDU] 1698 Just a Hook [线段树区间替换]
Just a Hook Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 开心菜鸟系列----变量的解读(javascript入门篇)
console.info( console.info(window['weiwu']) console.info(window. ...
- oracle ed命令
今天在弄oracle sqlplus的时候需要写一个存储过程,用ed进入之后,退不出来了. 从网上找到下面的方法处理: 如何退出sqlplus ed操作 今天进入sqlplus ,执行完语句后 ...
- java中byte数组与int类型的转换(两种方式)
http://blog.csdn.net/z69183787/article/details/38564219 http://blog.csdn.net/z69183787/article/detai ...
- LeetCode_Word Search
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from l ...
- Qt修改文件内容
在用Qt进行嵌入式开发的时候,有时需要通过界面永久的改变ip地址等网卡信息.此时只能修改系统中包含网卡信息的文件,下图红框中所示就是文件中的网卡信息. 那么如何修改这四行呢,我的做法是先打开该文本文件 ...
- 《Programming WPF》翻译 第7章 3.笔刷和钢笔
原文:<Programming WPF>翻译 第7章 3.笔刷和钢笔 为了在屏幕上绘制一个图形,WPF需要知道你想要为图形填充什么颜色以及如何绘制它的边框.WPF提供了一些Brush类型支 ...