From 46b7cd54a154df16d4c93d1e6c2e44bbc8c74399 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 11 May 2021 15:45:36 +0200 Subject: [PATCH] Log missing web application context at warn level (instead of debug) Closes gh-26925 --- .../web/context/support/SpringBeanAutowiringSupport.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java b/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java index b319a3d8c6..ab2a0f6042 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/SpringBeanAutowiringSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,10 +85,11 @@ public abstract class SpringBeanAutowiringSupport { bpp.processInjection(target); } else { - if (logger.isDebugEnabled()) { - logger.debug("Current WebApplicationContext is not available for processing of " + + if (logger.isWarnEnabled()) { + logger.warn("Current WebApplicationContext is not available for processing of " + ClassUtils.getShortName(target.getClass()) + ": " + - "Make sure this class gets constructed in a Spring web application. Proceeding without injection."); + "Make sure this class gets constructed in a Spring web application after the" + + "Spring WebApplicationContext has been initialized. Proceeding without injection."); } } }