Skip to content

Commit

Permalink
Polish recent changes to Log4jWebConfigurer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbrannen committed May 17, 2012
1 parent 98bf01a commit 59e3223
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@ public static void initLogging(ServletContext servletContext) {
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);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
log4j.rootCategory=DEBUG, mock
log4j.appender.mock=org.springframework.web.util.MockLog4jAppender

log4j.appender.mock=org.springframework.web.util.MockLog4jAppender

log4j.logger.org.springframework.mock.web=WARN

0 comments on commit 59e3223

Please sign in to comment.