Skip to content

Commit e518d7d

Browse files
committed
Mark log4j support classes as deprecated in favor of Apache Log4j 2 (following Apache's EOL declaration for log4j 1.x)
Issue: SPR-13400
1 parent b9d7913 commit e518d7d

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

spring-core/src/main/java/org/springframework/util/Log4jConfigurer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
* @since 13.03.2003
4242
* @see org.springframework.web.util.Log4jWebConfigurer
4343
* @see org.springframework.web.util.Log4jConfigListener
44+
* @deprecated as of Spring 4.2.1, in favor of Apache Log4j 2
45+
* (following Apache's EOL declaration for log4j 1.x)
4446
*/
47+
@Deprecated
4548
public abstract class Log4jConfigurer {
4649

4750
/** Pseudo URL prefix for loading from the class path: "classpath:" */

spring-web/src/main/java/org/springframework/web/context/request/Log4jNestedDiagnosticContextInterceptor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
* @since 2.5
3131
* @see org.apache.log4j.NDC#push(String)
3232
* @see org.apache.log4j.NDC#pop()
33+
* @deprecated as of Spring 4.2.1, in favor of Apache Log4j 2
34+
* (following Apache's EOL declaration for log4j 1.x)
3335
*/
36+
@Deprecated
3437
public class Log4jNestedDiagnosticContextInterceptor implements AsyncWebRequestInterceptor {
3538

3639
/** Logger available to subclasses */

spring-web/src/main/java/org/springframework/web/filter/Log4jNestedDiagnosticContextFilter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
* @see #setAfterMessageSuffix
3737
* @see org.apache.log4j.NDC#push(String)
3838
* @see org.apache.log4j.NDC#pop()
39+
* @deprecated as of Spring 4.2.1, in favor of Apache Log4j 2
40+
* (following Apache's EOL declaration for log4j 1.x)
3941
*/
42+
@Deprecated
4043
public class Log4jNestedDiagnosticContextFilter extends AbstractRequestLoggingFilter {
4144

4245
/** Logger available to subclasses */

spring-web/src/main/java/org/springframework/web/util/Log4jConfigListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
* @see Log4jWebConfigurer
3939
* @see org.springframework.web.context.ContextLoaderListener
4040
* @see WebAppRootListener
41+
* @deprecated as of Spring 4.2.1, in favor of Apache Log4j 2
42+
* (following Apache's EOL declaration for log4j 1.x)
4143
*/
44+
@Deprecated
4245
public class Log4jConfigListener implements ServletContextListener {
4346

4447
@Override

spring-web/src/main/java/org/springframework/web/util/Log4jWebConfigurer.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.io.FileNotFoundException;
2020
import javax.servlet.ServletContext;
2121

22-
import org.springframework.util.Log4jConfigurer;
2322
import org.springframework.util.ResourceUtils;
2423
import org.springframework.util.StringUtils;
2524

@@ -93,7 +92,10 @@
9392
* @since 12.08.2003
9493
* @see org.springframework.util.Log4jConfigurer
9594
* @see Log4jConfigListener
95+
* @deprecated as of Spring 4.2.1, in favor of Apache Log4j 2
96+
* (following Apache's EOL declaration for log4j 1.x)
9697
*/
98+
@Deprecated
9799
public abstract class Log4jWebConfigurer {
98100

99101
/** Parameter specifying the location of the log4j config file */
@@ -141,15 +143,15 @@ public static void initLogging(ServletContext servletContext) {
141143
// checking the file in the background.
142144
try {
143145
long refreshInterval = Long.parseLong(intervalString);
144-
Log4jConfigurer.initLogging(location, refreshInterval);
146+
org.springframework.util.Log4jConfigurer.initLogging(location, refreshInterval);
145147
}
146148
catch (NumberFormatException ex) {
147149
throw new IllegalArgumentException("Invalid 'log4jRefreshInterval' parameter: " + ex.getMessage());
148150
}
149151
}
150152
else {
151153
// Initialize without refresh check, i.e. without log4j's watchdog thread.
152-
Log4jConfigurer.initLogging(location);
154+
org.springframework.util.Log4jConfigurer.initLogging(location);
153155
}
154156
}
155157
catch (FileNotFoundException ex) {
@@ -167,7 +169,7 @@ public static void initLogging(ServletContext servletContext) {
167169
public static void shutdownLogging(ServletContext servletContext) {
168170
servletContext.log("Shutting down log4j");
169171
try {
170-
Log4jConfigurer.shutdownLogging();
172+
org.springframework.util.Log4jConfigurer.shutdownLogging();
171173
}
172174
finally {
173175
// Remove the web app root system property.

0 commit comments

Comments
 (0)