Polish recent changes to Log4jWebConfigurer

Reordered inline comments so that they now apply to current
state of the code.

Added logger entry in testlog4j.properties to avoid console
warning.

Issue: SPR-9417
This commit is contained in:
Sam Brannen
2012-05-17 18:05:38 +02:00
parent 98bf01adfb
commit 59e3223c84
2 changed files with 10 additions and 4 deletions

View File

@@ -122,11 +122,14 @@ public abstract class Log4jWebConfigurer {
if (location != null) {
// Perform actual log4j initialization; else rely on log4j's default initialization.
try {
// Return a URL (e.g. "classpath:" or "file:") as-is;
// consider a plain file path as relative to the web application root directory.
// Resolve system property placeholders before potentially
// resolving a real path.
location = SystemPropertyUtils.resolvePlaceholders(location);
// Leave a URL (e.g. "classpath:" or "file:") as-is.
if (!ResourceUtils.isUrl(location)) {
// Resolve system property placeholders before resolving real path.
// Consider a plain file path as relative to the web
// application root directory.
location = WebUtils.getRealPath(servletContext, location);
}