org.springframework.web.util.Log4jWebConfigurer
org.springframework.web.util.Log4jWebConfigurer
@Deprecated
Deprecated. as of Spring 4.2.1, in favor of Apache Log4j 2 (following Apache's EOL declaration for log4j 1.x)
Convenience class that performs custom log4j initialization for web environments, allowing for log file paths within the web application, with the option to perform automatic refresh checks (for runtime changes in logging configuration).
WARNING: Assumes an expanded WAR file, both for loading the configuration file and for writing the log files. If you want to keep your WAR unexpanded or don't need application-specific log files within the WAR directory, don't use log4j setup within the application (thus, don't use Log4jConfigListener or Log4jConfigServlet). Instead, use a global, VM-wide log4j setup (for example, in JBoss) or JDK 1.4's java.util.logging (which is global too).
Supports three init parameters at the servlet context level (that is, context-param entries in web.xml):
•"log4jConfigLocation":
Location of the log4j config file; either a "classpath:" location (e.g. "classpath:myLog4j.properties"), an absolute file URL (e.g. "file:C:/log4j.properties), or a plain path relative to the web application root directory (e.g. "/WEB-INF/log4j.properties"). If not specified, default log4j initialization will apply ("log4j.properties" or "log4j.xml" in the class path; see the log4j documentation for details).
•"log4jRefreshInterval":
Interval between config file refresh checks, in milliseconds. If not specified, no refresh checks will happen, which avoids starting log4j's watchdog thread.
•"log4jExposeWebAppRoot":
Whether the web app root system property should be exposed, allowing for log file paths relative to the web application root directory. Default is "true"; specify "false" to suppress expose of the web app root system property. See below for details on how to use this system property in log file locations.
Note: initLogging should be called before any other Spring activity (when using log4j), for proper initialization before any Spring logging attempts.
Log4j's watchdog thread will asynchronously check whether the timestamp of the config file has changed, using the given interval between checks. A refresh interval of 1000 milliseconds (one second), which allows to do on-demand log level changes with immediate effect, is not unfeasible.
WARNING: Log4j's watchdog thread does not terminate until VM shutdown; in particular, it does not terminate on LogManager shutdown. Therefore, it is recommended to not use config file refreshing in a production J2EE environment; the watchdog thread would not stop on application shutdown there.
By default, this configurer automatically sets the web app root system property, for "${key}" substitutions within log file locations in the log4j config file, allowing for log file paths relative to the web application root directory. The default system property key is "webapp.root", to be used in a log4j config file like as follows:
log4j.appender.myfile.File=${webapp.root}/WEB-INF/demo.log}
Alternatively, specify a unique context-param "webAppRootKey" per web application. For example, with "webAppRootKey = "demo.root":
log4j.appender.myfile.File=${demo.root}/WEB-INF/demo.log}
WARNING: Some containers (like Tomcat) do not keep system properties separate per web app. You have to use unique "webAppRootKey" context-params per web app then, to avoid clashes. Other containers like Resin do isolate each web app's system properties: Here you can use the default key (i.e. no "webAppRootKey" context-param at all) without worrying.
org.springframework.web.util.Log4jWebConfigurer的更多相关文章
- maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
环境:Groovy/Grails Tool Suite 3.1.0.RELEASE(BASED ON ECLIPSE JUNO 3.8.1).JDK1.6.Maven3.05.Tomcat6 错误描述 ...
- maven web启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
问题描述 SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfi ...
- org.springframework.web.util.IntrospectorCleanupListener的用途
Spring官方API中对其描述如下 /** * Listener that flushes the JDK's {@link java.beans.Introspector JavaBeans In ...
- org.springframework.web.util.NestedServletException : Handler processing failed; nested exception is java.lang.StackOverflowError
1 ,错误原因,循环冗余检查 result.setNearUsers(userList); Page page = new Page(); pag ...
- Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
在使用SpringMVC绑定基本类型(如String,Integer等)参数时,应通过@RequestParam注解指定具体的参数名称,否则,当源代码在非debug模式下编译后,运行时会引发Handl ...
- 解决java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
启动eclipse 发现如下错误 Error configuring application listener of class org.springframework.web.util.Log4jC ...
- java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
一:如果出现下面的错误信息,如果你的项目是Maven结构的,那么一般都是你的项目的Maven Dependencies没有添加到项目的编译路径下: 信息: The APR based Apache T ...
- Maven项目Eclipse启动时报错: java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
Eclipse中启动Maven项目时报如下错误: 严重: Error configuring application listener of class org.springframework.web ...
- gradle web项目启动报错: java.lang.ClassNotFoundException: org.springframework.web.util.IntrospectorCleanupListener
严重: Error configuring application listener of class org.springframework.web.util.IntrospectorCleanup ...
随机推荐
- ServiceWorker和WebWorker
在google打上关键字 service worker 空格进行搜索 参考地址 (Web_worker)[https://en.wikipedia.org/wiki/Web_worker] (serv ...
- FMS Dev Guide学习笔记(SharedBall)
一.开发交互式的媒体应用程序1.共享对象(Shared objects) ----SharedBall example 这个SharedBall example创建了一个临时的远程共享对象.类似于多人 ...
- 学JS的心路历程Day26 - PixiJS -入坑
后来知道也可以透过canvas让网页动起来! 而PixiJS是使用WebGL在canvas上绘制内容与制作动态 且同时有下列特色: 支持多点触控 掩码与混合模式 可外加WebGL滤镜 多装置支持 等等 ...
- 机器学习之overfiting
有错欢迎指正,别让小弟继续错下去. 我们在使用机器学习过程中,经常会overfiting,overfiting的产生原因是noise.训练样本大的话,还好,不用考虑这个 问题.但是,当数据量小的时候, ...
- 判断用户 是用的电脑还是手机 判断 是安卓还是IOS
$(function(){ var Terminal = { // 辨别移动终端类型 platform: function () { var u = navigator.userAgent, app ...
- C++访问二维数组元素
if(*image_in+j*+xsize+i)>=thresh)//xsize图像宽度 image_out是首地址,加上j*行宽就是目标行的首地址,再加上i,就是在此行中的第i个像素,所以整个 ...
- js中函数的 this、arguments 、caller,call(),apply(),bind()
在函数内部有两个特殊的对象,arguments 和 this,还有一个函数对象的属性caller. arguments对象 arguments是一个类似数组的对象,包含着传入函数的所有参数. func ...
- msf客户端渗透(一):payload利用简单示范
针对Windows 开启侦听 查看payload选项 将1.exe传到网页上 win7访问网页并下载1.exe 下载好之后双击运行,在服务器端就获得了一个shell 针对linux 先获取到一个软 ...
- Jmeter:性能测试指南(转)
http://yukinami.github.io/2015/11/26/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E6%8C%87%E5%8D%97/ 性能测试指南 ...
- MySQL数据类型及使用场景
MySQL数据类型介绍 整数类型 类型名称 说明 存储需求 取值范围有符号 取值范围符号 TINYINT 很小的整数 1个字节 -128~127 0-255 SMALLINT 小的整数 2个字节 32 ...