You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2014/09/30 04:33:45 UTC
[1/6] git commit: Add @since 2.1 to relevant methods.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 0c0e52ebd -> 431df2913
Add @since 2.1 to relevant methods.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/58535835
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/58535835
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/58535835
Branch: refs/heads/master
Commit: 5853583500a82be06fdb11c252d51a8eff1c3b3b
Parents: 0c0e52e
Author: Matt Sicker <ma...@apache.org>
Authored: Mon Sep 29 17:04:58 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Mon Sep 29 17:04:58 2014 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/logging/log4j/util/LoaderUtil.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/58535835/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
index 9ff24d4..7c3c7e7 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
@@ -95,6 +95,7 @@ public final class LoaderUtil {
* @param className The class name.
* @return the Class for the given name.
* @throws ClassNotFoundException if the specified class name could not be found
+ * @since 2.1
*/
public static Class<?> loadClass(final String className) throws ClassNotFoundException {
if (isIgnoreTccl()) {
@@ -117,6 +118,7 @@ public final class LoaderUtil {
* @throws InstantiationException if there was an exception whilst instantiating the class
* @throws NoSuchMethodException if there isn't a no-args constructor on the class
* @throws InvocationTargetException if there was an exception whilst constructing the class
+ * @since 2.1
*/
public static Object newInstanceOf(final String className)
throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException,
@@ -143,6 +145,7 @@ public final class LoaderUtil {
* @throws NoSuchMethodException if there isn't a no-args constructor on the class
* @throws InvocationTargetException if there was an exception whilst constructing the class
* @throws ClassCastException if the constructed object isn't type compatible with {@code T}
+ * @since 2.1
*/
public static <T> T newCheckedInstanceOf(final String className, final Class<T> clazz)
throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException,
[5/6] git commit: Use LoaderUtil.findResources.
Posted by ma...@apache.org.
Use LoaderUtil.findResources.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/20c80a94
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/20c80a94
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/20c80a94
Branch: refs/heads/master
Commit: 20c80a9407491b106bc0fb74c24c3a1a10a0fcbe
Parents: d80c6a2
Author: Matt Sicker <ma...@apache.org>
Authored: Mon Sep 29 21:32:43 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Mon Sep 29 21:32:43 2014 -0500
----------------------------------------------------------------------
.../logging/log4j/util/PropertiesUtil.java | 32 ++++++++------------
1 file changed, 12 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/20c80a94/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
index 3d74db5..04e94e1 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/PropertiesUtil.java
@@ -19,7 +19,6 @@ package org.apache.logging.log4j.util;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.Enumeration;
import java.util.Properties;
import org.apache.logging.log4j.Logger;
@@ -86,32 +85,25 @@ public final class PropertiesUtil {
* @param propertiesFileName the location of properties file to load
*/
public PropertiesUtil(final String propertiesFileName) {
- final ClassLoader loader = LoaderUtil.getThreadContextClassLoader();
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
- final
- Properties properties = new Properties();
+ final Properties properties = new Properties();
+ for (final URL url : LoaderUtil.findResources(propertiesFileName)) {
+ InputStream in = null;
try {
- final Enumeration<URL> enumeration = loader.getResources(propertiesFileName);
- while (enumeration.hasMoreElements()) {
- final URL url = enumeration.nextElement();
- final InputStream in = url.openStream();
+ in = url.openStream();
+ properties.load(in);
+ } catch (final IOException ioe) {
+ LOGGER.error("Unable to read {}", url.toString(), ioe);
+ } finally {
+ if (in != null) {
try {
- properties.load(in);
+ in.close();
} catch (final IOException ioe) {
- LOGGER.error("Unable to read {}", url.toString(), ioe);
- } finally {
- try {
- in.close();
- } catch (final IOException ioe) {
- LOGGER.error("Unable to close {}", url.toString(), ioe);
- }
+ LOGGER.error("Unable to close {}", url.toString(), ioe);
}
-
}
-
- } catch (final IOException ioe) {
- LOGGER.error("Unable to access {}", propertiesFileName, ioe);
}
+ }
this.props = properties;
}
[3/6] git commit: Add findResources method to LoaderUtil.
Posted by ma...@apache.org.
Add findResources method to LoaderUtil.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/ba39c4e4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ba39c4e4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ba39c4e4
Branch: refs/heads/master
Commit: ba39c4e4363b8257dec136e9c4ea8c4712b96ff7
Parents: 0fcb1bf
Author: Matt Sicker <ma...@apache.org>
Authored: Mon Sep 29 21:29:04 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Mon Sep 29 21:29:04 2014 -0500
----------------------------------------------------------------------
.../apache/logging/log4j/util/LoaderUtil.java | 66 +++++++++++++++++++-
1 file changed, 65 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/ba39c4e4/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
index 7c3c7e7..950fe1a 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
@@ -16,9 +16,14 @@
*/
package org.apache.logging.log4j.util;
+import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
+import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
/**
* <em>Consider this class private.</em> Utility class for ClassLoaders.
@@ -68,6 +73,7 @@ public final class LoaderUtil {
public static ClassLoader getThreadContextClassLoader() {
if (GET_CLASS_LOADER_DISABLED) {
// we can at least get this class's ClassLoader regardless of security context
+ // however, if this is null, there's really no option left at this point
return LoaderUtil.class.getClassLoader();
}
return SECURITY_MANAGER == null
@@ -79,7 +85,6 @@ public final class LoaderUtil {
@Override
public ClassLoader run() {
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
- // if the TCCL is null, that means we're using the system CL
if (cl != null) {
return cl;
}
@@ -161,4 +166,63 @@ public final class LoaderUtil {
}
return ignoreTCCL;
}
+
+ /**
+ * Finds classpath {@linkplain URL resources}.
+ *
+ * @param resource the name of the resource to find.
+ * @return a Collection of URLs matching the resource name. If no resources could be found, then this will be empty.
+ * @since 2.1
+ */
+ public static Collection<URL> findResources(final String resource) {
+ final Collection<UrlResource> urlResources = findUrlResources(resource);
+ final Collection<URL> resources = new LinkedHashSet<URL>(urlResources.size());
+ for (final UrlResource urlResource : urlResources) {
+ resources.add(urlResource.getUrl());
+ }
+ return resources;
+ }
+
+ static Collection<UrlResource> findUrlResources(final String resource) {
+ final ClassLoader[] candidates = {
+ getThreadContextClassLoader(),
+ LoaderUtil.class.getClassLoader(),
+ ClassLoader.getSystemClassLoader()
+ };
+ final Collection<UrlResource> resources = new LinkedHashSet<UrlResource>();
+ for (final ClassLoader cl : candidates) {
+ if (cl != null) {
+ try {
+ final Enumeration<URL> resourceEnum = cl.getResources(resource);
+ while (resourceEnum.hasMoreElements()) {
+ resources.add(new UrlResource(cl, resourceEnum.nextElement()));
+ }
+ } catch (final IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ return resources;
+ }
+
+ /**
+ * {@link URL} and {@link ClassLoader} pair.
+ */
+ static class UrlResource {
+ private final ClassLoader classLoader;
+ private final URL url;
+
+ public UrlResource(final ClassLoader classLoader, final URL url) {
+ this.classLoader = classLoader;
+ this.url = url;
+ }
+
+ public ClassLoader getClassLoader() {
+ return classLoader;
+ }
+
+ public URL getUrl() {
+ return url;
+ }
+ }
}
[2/6] git commit: Add javadoc
Posted by ma...@apache.org.
Add javadoc
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/0fcb1bf4
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/0fcb1bf4
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/0fcb1bf4
Branch: refs/heads/master
Commit: 0fcb1bf428fcec3c6f4902042a9756a8744922ab
Parents: 5853583
Author: Matt Sicker <ma...@apache.org>
Authored: Mon Sep 29 21:14:36 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Mon Sep 29 21:14:36 2014 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/logging/log4j/core/Appender.java | 4 ++++
.../apache/logging/log4j/core/appender/AbstractAppender.java | 7 ++++---
2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0fcb1bf4/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
index 354273a..3cfdde2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
@@ -68,6 +68,10 @@ public interface Appender extends LifeCycle {
*/
boolean ignoreExceptions();
+ /**
+ * Gets the {@link ErrorHandler} used for handling exceptions.
+ * @return
+ */
ErrorHandler getHandler();
void setHandler(ErrorHandler handler);
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0fcb1bf4/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
index cc55402..df04706 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
@@ -79,7 +79,7 @@ public abstract class AbstractAppender extends AbstractFilterable
}
/**
- * Handle an error with a message.
+ * Handle an error with a message using the {@link ErrorHandler} configured for this Appender.
* @param msg The message.
*/
public void error(final String msg) {
@@ -87,7 +87,8 @@ public abstract class AbstractAppender extends AbstractFilterable
}
/**
- * Handle an error with a message, and exception and a logging event.
+ * Handle an error with a message, exception, and a logging event, using the {@link ErrorHandler} configured for
+ * this Appender.
* @param msg The message.
* @param event The LogEvent.
* @param t The Throwable.
@@ -97,7 +98,7 @@ public abstract class AbstractAppender extends AbstractFilterable
}
/**
- * Handle an error with a message and an exception.
+ * Handle an error with a message and an exception using the {@link ErrorHandler} configured for this Appender.
* @param msg The message.
* @param t The Throwable.
*/
[4/6] git commit: Fix LOG4J2-862 for real this time.
Posted by ma...@apache.org.
Fix LOG4J2-862 for real this time.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d80c6a20
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d80c6a20
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d80c6a20
Branch: refs/heads/master
Commit: d80c6a20824bd13090bf80d415c02b39c53e8f21
Parents: ba39c4e
Author: Matt Sicker <ma...@apache.org>
Authored: Mon Sep 29 21:31:18 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Mon Sep 29 21:31:18 2014 -0500
----------------------------------------------------------------------
.../apache/logging/log4j/util/ProviderUtil.java | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d80c6a20/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
index 4ad71c9..bc3f774 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java
@@ -19,7 +19,6 @@ package org.apache.logging.log4j.util;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
-import java.util.Enumeration;
import java.util.HashSet;
import java.util.Properties;
import java.util.concurrent.locks.Lock;
@@ -53,22 +52,8 @@ public final class ProviderUtil {
private static volatile ProviderUtil INSTANCE;
private ProviderUtil() {
- final ClassLoader cl = findClassLoader();
- Enumeration<URL> enumResources = null;
- try {
- enumResources = cl.getResources(PROVIDER_RESOURCE);
- } catch (final IOException e) {
- LOGGER.fatal("Unable to locate {}", PROVIDER_RESOURCE, e);
- }
- loadProviders(enumResources, cl);
- }
-
- protected static void loadProviders(final Enumeration<URL> enumResources, final ClassLoader cl) {
- if (enumResources != null) {
- while (enumResources.hasMoreElements()) {
- final URL url = enumResources.nextElement();
- loadProvider(url, cl);
- }
+ for (LoaderUtil.UrlResource resource : LoaderUtil.findUrlResources(PROVIDER_RESOURCE)) {
+ loadProvider(resource.getUrl(), resource.getClassLoader());
}
}
[6/6] git commit: Move test log4j config files.
Posted by ma...@apache.org.
Move test log4j config files.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/431df291
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/431df291
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/431df291
Branch: refs/heads/master
Commit: 431df291362476fc103d4735fcfa1a65e9c964c4
Parents: 20c80a9
Author: Matt Sicker <ma...@apache.org>
Authored: Mon Sep 29 21:33:38 2014 -0500
Committer: Matt Sicker <ma...@apache.org>
Committed: Mon Sep 29 21:33:38 2014 -0500
----------------------------------------------------------------------
.../logging/log4j/web/ServletAppenderTest.java | 2 +-
.../apache/logging/log4j/web/WebLookupTest.java | 2 +-
.../resources/WEB-INF/classes/log4j-servlet.xml | 33 ++++++++++++++++++++
.../resources/WEB-INF/classes/log4j-webvar.xml | 29 +++++++++++++++++
log4j-web/src/test/resources/log4j-servlet.xml | 33 --------------------
log4j-web/src/test/resources/log4j-webvar.xml | 29 -----------------
6 files changed, 64 insertions(+), 64 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/431df291/log4j-web/src/test/java/org/apache/logging/log4j/web/ServletAppenderTest.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/java/org/apache/logging/log4j/web/ServletAppenderTest.java b/log4j-web/src/test/java/org/apache/logging/log4j/web/ServletAppenderTest.java
index e9bcc3d..d69455f 100644
--- a/log4j-web/src/test/java/org/apache/logging/log4j/web/ServletAppenderTest.java
+++ b/log4j-web/src/test/java/org/apache/logging/log4j/web/ServletAppenderTest.java
@@ -34,7 +34,7 @@ import static org.junit.Assert.*;
*/
public class ServletAppenderTest {
- private static final String CONFIG = "log4j-servlet.xml";
+ private static final String CONFIG = "WEB-INF/classes/log4j-servlet.xml";
@Test
public void testAppender() throws Exception {
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/431df291/log4j-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java b/log4j-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
index 6cf8a6b..a93262e 100644
--- a/log4j-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
+++ b/log4j-web/src/test/java/org/apache/logging/log4j/web/WebLookupTest.java
@@ -79,7 +79,7 @@ public class WebLookupTest {
servletContext.setInitParameter("myapp.logdir", "target");
servletContext.setAttribute("Name1", "Ben");
servletContext.setInitParameter("Name2", "Jerry");
- servletContext.setInitParameter("log4jConfiguration", "log4j-webvar.xml");
+ servletContext.setInitParameter("log4jConfiguration", "WEB-INF/classes/log4j-webvar.xml");
final Log4jWebLifeCycle initializer = WebLoggerContextUtils.getWebLifeCycle(servletContext);
initializer.start();
initializer.setLoggerContext();
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/431df291/log4j-web/src/test/resources/WEB-INF/classes/log4j-servlet.xml
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/resources/WEB-INF/classes/log4j-servlet.xml b/log4j-web/src/test/resources/WEB-INF/classes/log4j-servlet.xml
new file mode 100644
index 0000000..c4ede54
--- /dev/null
+++ b/log4j-web/src/test/resources/WEB-INF/classes/log4j-servlet.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<Configuration status="OFF" name="ServletTest">
+
+ <Appenders>
+ <Servlet name="Servlet">
+ <PatternLayout pattern="%m%n"/>
+ </Servlet>
+ </Appenders>
+
+ <Loggers>
+ <Root level="debug">
+ <AppenderRef ref="Servlet"/>
+ </Root>
+ </Loggers>
+
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/431df291/log4j-web/src/test/resources/WEB-INF/classes/log4j-webvar.xml
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/resources/WEB-INF/classes/log4j-webvar.xml b/log4j-web/src/test/resources/WEB-INF/classes/log4j-webvar.xml
new file mode 100644
index 0000000..de3777a
--- /dev/null
+++ b/log4j-web/src/test/resources/WEB-INF/classes/log4j-webvar.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<Configuration status="OFF">
+ <Appenders>
+ <File name="file" fileName="${web:initParam.myapp.logdir}/myapp.log" append="true">
+ <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+ </File>
+ </Appenders>
+ <Loggers>
+ <Root level="warn">
+ <AppenderRef ref="file"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/431df291/log4j-web/src/test/resources/log4j-servlet.xml
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/resources/log4j-servlet.xml b/log4j-web/src/test/resources/log4j-servlet.xml
deleted file mode 100644
index c4ede54..0000000
--- a/log4j-web/src/test/resources/log4j-servlet.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<Configuration status="OFF" name="ServletTest">
-
- <Appenders>
- <Servlet name="Servlet">
- <PatternLayout pattern="%m%n"/>
- </Servlet>
- </Appenders>
-
- <Loggers>
- <Root level="debug">
- <AppenderRef ref="Servlet"/>
- </Root>
- </Loggers>
-
-</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/431df291/log4j-web/src/test/resources/log4j-webvar.xml
----------------------------------------------------------------------
diff --git a/log4j-web/src/test/resources/log4j-webvar.xml b/log4j-web/src/test/resources/log4j-webvar.xml
deleted file mode 100644
index de3777a..0000000
--- a/log4j-web/src/test/resources/log4j-webvar.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<Configuration status="OFF">
- <Appenders>
- <File name="file" fileName="${web:initParam.myapp.logdir}/myapp.log" append="true">
- <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
- </File>
- </Appenders>
- <Loggers>
- <Root level="warn">
- <AppenderRef ref="file"/>
- </Root>
- </Loggers>
-</Configuration>
\ No newline at end of file