Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D6EA0200C0B for ; Sun, 15 Jan 2017 03:40:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D555E160B51; Sun, 15 Jan 2017 02:40:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BAC7B160B35 for ; Sun, 15 Jan 2017 03:40:43 +0100 (CET) Received: (qmail 63305 invoked by uid 500); 15 Jan 2017 02:40:42 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 63295 invoked by uid 99); 15 Jan 2017 02:40:42 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2017 02:40:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1EA06C0370 for ; Sun, 15 Jan 2017 02:40:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.541 X-Spam-Level: *** X-Spam-Status: No, score=3.541 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_10_20=1.162, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id STADat9SDREf for ; Sun, 15 Jan 2017 02:40:32 +0000 (UTC) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 9D8D85F286 for ; Sun, 15 Jan 2017 02:40:31 +0000 (UTC) Received: by mail-wm0-f54.google.com with SMTP id c85so114657911wmi.1 for ; Sat, 14 Jan 2017 18:40:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=U+TceaPFbkEW3SaCFDLM1pPAVXIUKraV8cpI3kS1GdQ=; b=KcA6OYRsPQUn791QPqRFOM3TIWOhvZqpyIn2GsnVx/DdpcmiUaF24MbR1jAM5ZklSB hSadu6k/tBoxVfW2/s3/WcVxzmPQU1/f64doo4+p2gXV58jyIjlQ0xJw6YoSVjWvIEmw DZd+jpzOPS22KwnWWdI738VRJNClFY3tVd9r2YwuHIh8vok2dHw6Tuae1BdhAsGAcYaa 5DGNjcakcvzsMJn0fzFBbtNMRpUKDTHrxAAmUblmkNuPPIsF0YGehaF869kMTtujZlw3 zyG98H5dlQiVu+xxEdQh7p6mY55qJ2ZWk2kFcmU2YmBEL/nK4RS1MkOd4O7oF5owyJku 9H/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=U+TceaPFbkEW3SaCFDLM1pPAVXIUKraV8cpI3kS1GdQ=; b=L+WUBZr7h6s2tPTTyM5sdkXiE8fhFpNmGy0fnBhe7dYFRJ3v3A8h4a5Mqz/zJpMVBk HOxtjrJsKBGp3ms9q5CEO59acXfRv3IzYT36VGyQFT4tta5Q0xAVmO5n3JBC3/BgFCdv P8zpK9UyC/koxJIc6Cz+cwYVvaoTrLd3KpFMUDYxqsUJE7pqNUPL0971+pbTAomlHlDe ahrXwCOBemyJVKDIXOuDLdp/yOYA10G1+IK7eMitpkFmHbmhBe6AqujQg5geEfLkVtjr am7z0f4B7TFF/9jW3Wiknn7DLkoVivDVZxHQOwoMgzszLfNm9XNhtNDJB9den4wdERE+ jELw== X-Gm-Message-State: AIkVDXL0KtyVugILiA7pgqLXQw/wASB7CbRyXfS1wpnsGefy85c7vB6dVGpS3g6OcUClSSlRXBlF/0Op9VYVcw== X-Received: by 10.28.148.76 with SMTP id w73mr7581377wmd.74.1484448024548; Sat, 14 Jan 2017 18:40:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.146.116 with HTTP; Sat, 14 Jan 2017 18:40:23 -0800 (PST) In-Reply-To: References: <1439226623844dc4a2d5433689268682@git.apache.org> From: Matt Sicker Date: Sat, 14 Jan 2017 20:40:23 -0600 Message-ID: Subject: Re: logging-log4j-boot git commit: Add log4j-boot-spring module To: Log4J Developers List Content-Type: multipart/alternative; boundary=001a114b79a430da03054618fdb8 archived-at: Sun, 15 Jan 2017 02:40:46 -0000 --001a114b79a430da03054618fdb8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In Spring Boot, Tomcat is on the same classpath as everything else I think as it's embedded. On 14 January 2017 at 20:30, Apache wrote: > I have run into problems with log4j-jul. It does not work well in Tomcat > as the jar really has to be in Tomcat=E2=80=99s classpath, which means al= l the > other log4j jars also need to be. It also has to initialize before Tomcat > starts using java.util.logging, which is a bit of a pain. I don=E2=80=99t= think > there is any decent way to improve it to fix the problems you note. I jus= t > try to avoid everything that uses jul for logging. > > Ralph > > On Jan 14, 2017, at 4:43 PM, Matt Sicker wrote: > > So would it be a decent idea to add a similar extended > LoggerContextFactory to log4j-jul so it auto sets up in other environment= s? > I find that specifying the system property at the right time in code is > very difficult to get right, and the reason this worked well enough with > spring boot was because of the main class used in your main method callin= g > LogFactory.getLogger() on initialization. > > ---------- Forwarded message ---------- > From: > Date: 14 January 2017 at 17:40 > Subject: logging-log4j-boot git commit: Add log4j-boot-spring module > To: commits@logging.apache.org > > > Repository: logging-log4j-boot > Updated Branches: > refs/heads/master 35f38d944 -> 3619ca0c2 > > > Add log4j-boot-spring module > > This is a spring-boot-starter module for bootstrapping Log4j > accordingly with default config files inspired by > spring-boot-starter-log4j2. > > > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/repo > Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/co > mmit/3619ca0c > Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/tr > ee/3619ca0c > Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/di > ff/3619ca0c > > Branch: refs/heads/master > Commit: 3619ca0c2abd62f3ef18369987fa376f562a8dac > Parents: 35f38d9 > Author: Matt Sicker > Authored: Sat Jan 14 17:39:12 2017 -0600 > Committer: Matt Sicker > Committed: Sat Jan 14 17:39:12 2017 -0600 > > ---------------------------------------------------------------------- > pom.xml | 4 + > spring/pom.xml | 66 +++++++ > .../AutoConfiguringLoggerContextFactory.java | 34 ++++ > .../log4j/boot/spring/Log4jLoggingSystem.java | 191 ++++++++++++++++++= + > .../META-INF/log4j/default/log4j2-file.xml | 57 ++++++ > .../resources/META-INF/log4j/default/log4j2.xml | 50 +++++ > .../main/resources/log4j2.component.properties | 20 ++ > .../boot/spring/LoggingInitializerTest.java | 62 ++++++ > 8 files changed, 484 insertions(+) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/pom.xml > ---------------------------------------------------------------------- > diff --git a/pom.xml b/pom.xml > index 415da22..ea5cd77 100644 > --- a/pom.xml > +++ b/pom.xml > @@ -43,6 +43,8 @@ > https://logging.apache.org/log4j/boot/ > > > + 1.7 > + 1.7 > 2.7.1-SNAPSHOT > 1.7.22 > 5.14.1 > @@ -62,6 +64,7 @@ > 1.1.8 > 0.10.1.1 > 3.4.1 > + 1.4.3.RELEASE > > > > @@ -90,6 +93,7 @@ > layout/xml > layout/yaml > script/groovy > + spring > > > > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/pom.xml > ---------------------------------------------------------------------- > diff --git a/spring/pom.xml b/spring/pom.xml > new file mode 100644 > index 0000000..5985328 > --- /dev/null > +++ b/spring/pom.xml > @@ -0,0 +1,66 @@ > + > + > + > + + xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" > + xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > + > + log4j-boot-parent > + org.apache.logging.log4j.boot > + 1.0-SNAPSHOT > + > + 4.0.0 > + > + log4j-boot-spring > + Log4j Spring Boot Starter > + > + Log4j Boot module for integration with Spring Boot. This module can > be used as a complete replacement for > + spring-boot-starter-logging or spring-boot-starter-log4j2. > + > + > + > + > + org.apache.logging.log4j.boot > + log4j-boot-core > + 1.0-SNAPSHOT > + compile > + > + > + org.apache.logging.log4j.boot > + log4j-boot-compat > + 1.0-SNAPSHOT > + compile > + > + > + org.springframework.boot > + spring-boot > + ${springbootVersion} > + compile > + > + > + > + org.springframework.boot > + spring-boot-starter-test > + ${springbootVersion} > + test > + > + > + > + > \ No newline at end of file > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/src/main/java/org/apache/logging/log4j/bo > ot/spring/AutoConfiguringLoggerContextFactory.java > ---------------------------------------------------------------------- > diff --git a/spring/src/main/java/org/apache/logging/log4j/boot/spring/ > AutoConfiguringLoggerContextFactory.java b/spring/src/main/java/org/apa > che/logging/log4j/boot/spring/AutoConfiguringLoggerContextFactory.java > new file mode 100644 > index 0000000..706f1db > --- /dev/null > +++ b/spring/src/main/java/org/apache/logging/log4j/boot/spring/ > AutoConfiguringLoggerContextFactory.java > @@ -0,0 +1,34 @@ > +/* > + * 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. > + */ > +package org.apache.logging.log4j.boot.spring; > + > +import org.apache.logging.log4j.core.impl.Log4jContextFactory; > +import org.springframework.boot.logging.LoggingSystem; > + > +/** > + * LoggerContextFactory extension to automatically register logging > systems. > + */ > +public class AutoConfiguringLoggerContextFactory extends > Log4jContextFactory { > + > + static { > + System.setProperty("java.util.logging.manager", > "org.apache.logging.log4j.jul.LogManager"); > + System.setProperty(LoggingSystem.SYSTEM_PROPERTY, > Log4jLoggingSystem.class.getName()); > + } > + > +} > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/src/main/java/org/apache/logging/log4j/bo > ot/spring/Log4jLoggingSystem.java > ---------------------------------------------------------------------- > diff --git a/spring/src/main/java/org/apache/logging/log4j/boot/spring/Lo= g4jLoggingSystem.java > b/spring/src/main/java/org/apache/logging/log4j/boot/spring/ > Log4jLoggingSystem.java > new file mode 100644 > index 0000000..e0bad83 > --- /dev/null > +++ b/spring/src/main/java/org/apache/logging/log4j/boot/spring/ > Log4jLoggingSystem.java > @@ -0,0 +1,191 @@ > +/* > + * 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. > + */ > +package org.apache.logging.log4j.boot.spring; > + > +import org.apache.logging.log4j.Level; > +import org.apache.logging.log4j.LogManager; > +import org.apache.logging.log4j.core.Logger; > +import org.apache.logging.log4j.core.LoggerContext; > +import org.apache.logging.log4j.core.config.ConfigurationFactory; > +import org.apache.logging.log4j.core.config.LoggerConfig; > +import org.apache.logging.log4j.core.config.plugins.util.PluginManager; > +import org.apache.logging.log4j.core.config.plugins.util.PluginType; > +import org.apache.logging.log4j.core.util.NetUtils; > +import org.apache.logging.log4j.core.util.ReflectionUtil; > +import org.apache.logging.log4j.core.util.Throwables; > +import org.apache.logging.log4j.util.Strings; > +import org.springframework.boot.logging.AbstractLoggingSystem; > +import org.springframework.boot.logging.LogFile; > +import org.springframework.boot.logging.LogLevel; > +import org.springframework.boot.logging.LoggingInitializationContext; > + > +import java.lang.reflect.Method; > +import java.net.URI; > +import java.util.ArrayList; > +import java.util.Collection; > +import java.util.List; > + > +/** > + * Spring Boot LoggingSystem for integration with Log4j 2. > + */ > +public class Log4jLoggingSystem extends AbstractLoggingSystem { > + > + static { > + Method factoryIsActive; > + Method factorySupportedTypes; > + try { > + factoryIsActive =3D ConfigurationFactory.class.get > DeclaredMethod("isActive"); > + ReflectionUtil.makeAccessible(factoryIsActive); > + factorySupportedTypes =3D ConfigurationFactory.class.get > DeclaredMethod("getSupportedTypes"); > + ReflectionUtil.makeAccessible(factorySupportedTypes); > + } catch (final NoSuchMethodException e) { > + Throwables.rethrow(e); > + // unreachable; make the compiler happy > + factoryIsActive =3D null; > + factorySupportedTypes =3D null; > + } > + FACTORY_IS_ACTIVE =3D factoryIsActive; > + FACTORY_SUPPORTED_TYPES =3D factorySupportedTypes; > + } > + > + private static final Method FACTORY_IS_ACTIVE; > + private static final Method FACTORY_SUPPORTED_TYPES; > + > + private final String[] standardConfigLocations; > + private LoggerContext loggerContext; > + > + public Log4jLoggingSystem(final ClassLoader classLoader) { > + super(classLoader); > + this.standardConfigLocations =3D determineStandardConfigLocatio > ns(); > + } > + > + private static String[] determineStandardConfigLocations() { > + final List locations =3D new ArrayList<>(); > + for (final ConfigurationFactory factory : findFactories()) { > + for (final String extension : getSupportedTypes(factory)) { > + if ("*".equals(extension)) { > + continue; > + } > + locations.add("log4j2-test" + extension); > + locations.add("log4j2" + extension); > + } > + } > + return locations.toArray(new String[0]); > + } > + > + private static Collection findFactories() { > + final PluginManager manager =3D new PluginManager(ConfigurationF= ac > tory.CATEGORY); > + manager.collectPlugins(); > + final Collection factories =3D new > ArrayList<>(); > + for (final PluginType type : manager.getPlugins().values()) { > + final ConfigurationFactory factory =3D tryCreateFactory(type= ); > + if (factory !=3D null) { > + factories.add(factory); > + } > + } > + return factories; > + } > + > + private static ConfigurationFactory tryCreateFactory(final > PluginType pluginType) { > + try { > + return pluginType.getPluginClass().as > Subclass(ConfigurationFactory.class).newInstance(); > + } catch (final Exception ignored) { > + return null; > + } > + } > + > + private static String[] getSupportedTypes(final ConfigurationFactory > factory) { > + try { > + if ((boolean) FACTORY_IS_ACTIVE.invoke(factory)) { > + return (String[]) FACTORY_SUPPORTED_TYPES.invoke > (factory); > + } > + } catch (final Exception ignored) { > + } > + return new String[0]; > + } > + > + @Override > + protected String[] getStandardConfigLocations() { > + return standardConfigLocations; > + } > + > + @Override > + protected void loadDefaults(final LoggingInitializationContext > context, final LogFile file) { > + final String configFileName =3D "classpath:META-INF/log4j/defa > ult/log4j2" > + + ((file =3D=3D null) ? Strings.EMPTY : "-file") > + + ".xml"; > + loadConfiguration(context, configFileName, file); > + } > + > + @Override > + protected void loadConfiguration(final LoggingInitializationContext > context, final String location, > + final LogFile file) { > + final URI configLocation =3D NetUtils.toURI(location); > + loggerContext =3D (LoggerContext) LogManager.getContext( > + getClassLoader(), false, this, configLocation); > + } > + > + @Override > + protected void reinitialize(final LoggingInitializationContext > context) { > + if (loggerContext !=3D null) { > + loggerContext.reconfigure(); > + } > + } > + > + @Override > + public void cleanUp() { > + if (loggerContext !=3D null) { > + loggerContext.setExternalContext(null); > + loggerContext.terminate(); > + } > + } > + > + @Override > + public void setLogLevel(final String loggerName, final LogLevel > logLevel) { > + if (loggerContext !=3D null) { > + final Logger logger =3D loggerContext.getLogger(loggerName); > + final LoggerConfig config =3D logger.get(); > + final Level level =3D convert(logLevel); > + if (config.getLevel() !=3D level) { > + config.setLevel(level); > + } > + } > + } > + > + private static Level convert(final LogLevel logLevel) { > + switch (logLevel) { > + case FATAL: > + return Level.FATAL; > + case ERROR: > + return Level.ERROR; > + case WARN: > + return Level.WARN; > + case INFO: > + return Level.INFO; > + case DEBUG: > + return Level.DEBUG; > + case TRACE: > + return Level.TRACE; > + case OFF: > + return Level.OFF; > + default: > + return Level.toLevel(logLevel.name()); > + } > + } > +} > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/src/main/resources/META-INF/log4j/default > /log4j2-file.xml > ---------------------------------------------------------------------- > diff --git a/spring/src/main/resources/META-INF/log4j/default/log4j2-file= .xml > b/spring/src/main/resources/META-INF/log4j/default/log4j2-file.xml > new file mode 100644 > index 0000000..9880ceb > --- /dev/null > +++ b/spring/src/main/resources/META-INF/log4j/default/log4j2-file.xml > @@ -0,0 +1,57 @@ > + > + > + > + > + > + ???? > + _WORD">%xEx > + %5p > + %d{yyyy-MM-dd HH:mm:ss.SSS= } > ${LOG_LEVEL_PATTERN} ${sys:PID} --- [%t] %-40.40c{1.} : > %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD} > + > + > + > + > + > + filePattern=3D"logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz"> > + > + > + > + > + > + > + > + level=3D"error" /> > + level=3D"error" /> > + level=3D"warn" /> > + level=3D"warn"/> > + level=3D"warn" /> > + > + > + level=3D"error" /> > + level=3D"warn" /> > + .actuate.autoconfigure.CrshAutoConfiguration" level=3D"warn"/> > + level=3D"warn"/> > + > + > + > + > + > + > + > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/src/main/resources/META-INF/log4j/default/log4j2.xml > ---------------------------------------------------------------------- > diff --git a/spring/src/main/resources/META-INF/log4j/default/log4j2.xml > b/spring/src/main/resources/META-INF/log4j/default/log4j2.xml > new file mode 100644 > index 0000000..2ede5aa > --- /dev/null > +++ b/spring/src/main/resources/META-INF/log4j/default/log4j2.xml > @@ -0,0 +1,50 @@ > + > + > + > + > + > + ???? > + _WORD">%xEx > + %5p > + %style{%d{yyyy-MM-dd > HH:mm:ss.SSS}}{dim} %highlight{${LOG_LEVEL_PATTERN}} > %style{${sys:PID}}{magenta} %style{---}{dim} %style{[%15.15t]}{dim} > %style{%-40.40c{1.}}{cyan} %style{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVE= R > SION_WORD} > + > + > + > + > + > + > + > + level=3D"error" /> > + level=3D"error" /> > + level=3D"warn" /> > + level=3D"warn"/> > + level=3D"warn" /> > + > + > + level=3D"error" /> > + level=3D"warn" /> > + .actuate.autoconfigure.CrshAutoConfiguration" level=3D"warn"/> > + level=3D"warn"/> > + > + > + > + > + > + > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/src/main/resources/log4j2.component.properties > ---------------------------------------------------------------------- > diff --git a/spring/src/main/resources/log4j2.component.properties > b/spring/src/main/resources/log4j2.component.properties > new file mode 100644 > index 0000000..34d00f4 > --- /dev/null > +++ b/spring/src/main/resources/log4j2.component.properties > @@ -0,0 +1,20 @@ > +# > +# 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. > +# > + > +log4j2.loggerContextFactory =3D org.apache.logging.log4j.boot. > spring.AutoConfiguringLoggerContextFactory > \ No newline at end of file > > http://git-wip-us.apache.org/repos/asf/logging-log4j-boot/bl > ob/3619ca0c/spring/src/test/java/org/apache/logging/log4j/bo > ot/spring/LoggingInitializerTest.java > ---------------------------------------------------------------------- > diff --git a/spring/src/test/java/org/apache/logging/log4j/boot/spring/Lo= ggingInitializerTest.java > b/spring/src/test/java/org/apache/logging/log4j/boot/spring/ > LoggingInitializerTest.java > new file mode 100644 > index 0000000..b7002f3 > --- /dev/null > +++ b/spring/src/test/java/org/apache/logging/log4j/boot/spring/ > LoggingInitializerTest.java > @@ -0,0 +1,62 @@ > +/* > + * 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. > + */ > + > +package org.apache.logging.log4j.boot.spring; > + > +import org.apache.commons.logging.LogFactory; > +import org.apache.logging.log4j.jcl.LogFactoryImpl; > +import org.apache.logging.slf4j.Log4jLoggerFactory; > +import org.junit.Test; > +import org.junit.runner.RunWith; > +import org.slf4j.ILoggerFactory; > +import org.slf4j.LoggerFactory; > +import org.springframework.boot.autoconfigure.SpringBootApplication; > +import org.springframework.boot.test.context.SpringBootTest; > +import org.springframework.test.context.junit4.SpringRunner; > + > +import java.util.logging.LogManager; > + > +import static org.assertj.core.api.Assertions.assertThat; > + > +/** > + * Integration test to verify Spring Boot uses the proper logging facade= s. > + */ > +@RunWith(SpringRunner.class) > +@SpringBootApplication > +@SpringBootTest > +public class LoggingInitializerTest { > + > + @Test > + public void testJavaUtilLogManagerSet() throws Throwable { > + LogManager logManager =3D LogManager.getLogManager(); > + assertThat(logManager).isInstanceOf(org.apache.logging. > log4j.jul.LogManager.class); > + } > + > + @Test > + public void testCommonsLogFactorySet() throws Throwable { > + LogFactory logFactory =3D LogFactory.getFactory(); > + assertThat(logFactory).isInstanceOf(LogFactoryImpl.class); > + } > + > + @Test > + public void testSlf4jFactorySet() throws Exception { > + ILoggerFactory factory =3D LoggerFactory.getILoggerFactory(); > + assertThat(factory).isInstanceOf(Log4jLoggerFactory.class); > + } > +} > \ No newline at end of file > > > > > -- > Matt Sicker > > > --=20 Matt Sicker --001a114b79a430da03054618fdb8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In Spring Boot, Tomcat is on the same classpath as everyth= ing else I think as it's embedded.

=
On 14 January 2017 at 20:30, Apache <r= alph.goers@dslextreme.com> wrote:
I have run into problems wi= th log4j-jul. It does not work well in Tomcat as the jar really has to be i= n Tomcat=E2=80=99s classpath, which means all the other log4j jars also nee= d to be. It also has to initialize before Tomcat starts using java.util.log= ging, which is a bit of a pain. I don=E2=80=99t think there is any decent w= ay to improve it to fix the problems you note. I just try to avoid everythi= ng that uses jul for logging.

Ralph

On Jan 14, 2017, at 4= :43 PM, Matt Sicker <boards@gmail.com> wrote:

So would it be a decen= t idea to add a similar extended LoggerContextFactory to log4j-jul so it au= to sets up in other environments? I find that specifying the system propert= y at the right time in code is very difficult to get right, and the reason = this worked well enough with spring boot was because of the main class used= in your main method calling LogFactory.getLogger() on initialization.
---------- Forwarded message ----------
= From: <mattsicker@apache.org>= ;
Date: 14 January 2017 at 17:40
Subject: logging-log4j-boot g= it commit: Add log4j-boot-spring module
To: commits@logging.apache.org

<= br>Repository: logging-log4j-boot
Updated Branches:
=C2=A0 refs/heads/master 35f38d944 -> 3619ca0c2


Add log4j-boot-spring module

This is a spring-boot-starter module for bootstrapping Log4j
accordingly with default config files inspired by
spring-boot-starter-log4j2.


Project: http://git-wip-us.apache.org/= repos/asf/logging-log4j-boot/repo
Commit: http://git-wip-us.a= pache.org/repos/asf/logging-log4j-boot/commit/3619ca0c
Tree: http://git-wip-us.apach= e.org/repos/asf/logging-log4j-boot/tree/3619ca0c
Diff: http://git-wip-us.apach= e.org/repos/asf/logging-log4j-boot/diff/3619ca0c

Branch: refs/heads/master
Commit: 3619ca0c2abd62f3ef18369987fa376f562a8dac
Parents: 35f38d9
Author: Matt Sicker <boards@gmail.com>
Authored: Sat Jan 14 17:39:12 2017 -0600
Committer: Matt Sicker <boards@gmail.com>
Committed: Sat Jan 14 17:39:12 2017 -0600

-----------------------------------------------------------------= -----
=C2=A0pom.xml=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|=C2=A0 =C2=A04 +
=C2=A0spring/pom.xml=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 66 = +++++++
=C2=A0.../AutoConfiguringLoggerContextFactory.java=C2=A0 =C2=A0 |=C2= =A0 34 ++++
=C2=A0.../log4j/boot/spring/Log4jLoggingSystem.java=C2=A0 =C2=A0| 191 = +++++++++++++++++++
=C2=A0.../META-INF/log4j/default/log4j2-file.xml=C2=A0 =C2=A0 =C2=A0 |= =C2=A0 57 ++++++
=C2=A0.../resources/META-INF/log4j/default/log4j2.xml |=C2=A0 50 +++++=
=C2=A0.../main/resources/log4j2.comp= onent.properties=C2=A0 |=C2=A0 20 ++
=C2=A0.../boot/spring/LoggingInitializerTest.java=C2=A0 =C2=A0 =C2=A0|= =C2=A0 62 ++++++
=C2=A08 files changed, 484 insertions(+)
-----------------------------------------------------------------= -----


http://git-wip-us.apa= che.org/repos/asf/logging-log4j-boot/blob/3619ca0c/pom.xml -----------------------------------------------------------------= -----
diff --git a/pom.xml b/pom.xml
index 415da22..ea5cd77 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,6 +43,8 @@
=C2=A0 =C2=A0<url>https://logging.apache.org/log4j/= boot/</url>

=C2=A0 =C2=A0<properties>
+=C2=A0 =C2=A0 <maven.compiler.source>1.7</maven.compiler.sou= rce>
+=C2=A0 =C2=A0 <maven.compiler.target>1.7</maven.compiler.tar= get>
=C2=A0 =C2=A0 =C2=A0<log4jVersion>2.7.1-SNAPSHOT</log4jVersio= n>
=C2=A0 =C2=A0 =C2=A0<slf4jVersion>1.7.22</slf4jVersion> =C2=A0 =C2=A0 =C2=A0<activemqVersion>5.14.1</activemqVersion&= gt;
@@ -62,6 +64,7 @@
=C2=A0 =C2=A0 =C2=A0<logbackVersion>1.1.8</logbackVersion>=
=C2=A0 =C2=A0 =C2=A0<kafkaVersion>0.10.1.1</kafkaVersion><= br> =C2=A0 =C2=A0 =C2=A0<mongodbVersion>3.4.1</mongodbVersion>=
+=C2=A0 =C2=A0 <springbootVersion>1.4.3.RELEASE</springbootVe= rsion>
=C2=A0 =C2=A0</properties>

=C2=A0 =C2=A0<modules>
@@ -90,6 +93,7 @@
=C2=A0 =C2=A0 =C2=A0<module>layout/xml</module>
=C2=A0 =C2=A0 =C2=A0<module>layout/yaml</module>
=C2=A0 =C2=A0 =C2=A0<module>script/groovy</module>
+=C2=A0 =C2=A0 <module>spring</module>
=C2=A0 =C2=A0</modules>

=C2=A0 =C2=A0<scm>

http://git-wip= -us.apache.org/repos/asf/logging-log4j-boot/blob/3619ca0c/spring/= pom.xml
-----------------------------------------------------------------= -----
diff --git a/spring/pom.xml b/spring/pom.xml
new file mode 100644
index 0000000..5985328
--- /dev/null
+++ b/spring/pom.xml
@@ -0,0 +1,66 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<!--
+=C2=A0 ~ Licensed to the Apache Software Foundation (ASF) under one
+=C2=A0 ~ or more contributor license agreements.=C2=A0 See the NOTICE file=
+=C2=A0 ~ distributed with this work for additional information
+=C2=A0 ~ regarding copyright ownership.=C2=A0 The ASF licenses this file +=C2=A0 ~ to you under the Apache License, Version 2.0 (the
+=C2=A0 ~ "License"); you may not use this file except in complia= nce
+=C2=A0 ~ with the License.=C2=A0 You may obtain a copy of the License at +=C2=A0 ~
+=C2=A0 ~=C2=A0 =C2=A0http://www.apache.org/licenses/= LICENSE-2.0
+=C2=A0 ~
+=C2=A0 ~ Unless required by applicable law or agreed to in writing,
+=C2=A0 ~ software distributed under the License is distributed on an
+=C2=A0 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY<= br> +=C2=A0 ~ KIND, either express or implied.=C2=A0 See the License for the +=C2=A0 ~ specific language governing permissions and limitations
+=C2=A0 ~ under the License.
+=C2=A0 -->
+
+<project xmlns=3D"http://maven.apache.org/POM/4.0.0"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xmlns:xsi=3D"
http:/= /www.w3.org/2001/XMLSchema-instance"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xsi:schemaLocation=3D"http:= //maven.apache.org/POM/4.0.0 http://maven.apache= .org/xsd/maven-4.0.0.xsd">
+=C2=A0 <parent>
+=C2=A0 =C2=A0 <artifactId>log4j-boot-parent</artifactId><= br> +=C2=A0 =C2=A0 <groupId>org.apache.logging.log4j.boot</groupI= d>
+=C2=A0 =C2=A0 <version>1.0-SNAPSHOT</version>
+=C2=A0 </parent>
+=C2=A0 <modelVersion>4.0.0</modelVersion>
+
+=C2=A0 <artifactId>log4j-boot-spring</artifactId>
+=C2=A0 <name>Log4j Spring Boot Starter</name>
+=C2=A0 <description>
+=C2=A0 =C2=A0 Log4j Boot module for integration with Spring Boot. This mod= ule can be used as a complete replacement for
+=C2=A0 =C2=A0 spring-boot-starter-logging or spring-boot-starter-log4j2. +=C2=A0 </description>
+
+=C2=A0 <dependencies>
+=C2=A0 =C2=A0 <dependency>
+=C2=A0 =C2=A0 =C2=A0 <groupId>org.apache.logging.log4j.boot<= /groupId>
+=C2=A0 =C2=A0 =C2=A0 <artifactId>log4j-boot-core</artifactId= >
+=C2=A0 =C2=A0 =C2=A0 <version>1.0-SNAPSHOT</version>
+=C2=A0 =C2=A0 =C2=A0 <scope>compile</scope>
+=C2=A0 =C2=A0 </dependency>
+=C2=A0 =C2=A0 <dependency>
+=C2=A0 =C2=A0 =C2=A0 <groupId>org.apache.logging.log4j.boot<= /groupId>
+=C2=A0 =C2=A0 =C2=A0 <artifactId>log4j-boot-compat</artifact= Id>
+=C2=A0 =C2=A0 =C2=A0 <version>1.0-SNAPSHOT</version>
+=C2=A0 =C2=A0 =C2=A0 <scope>compile</scope>
+=C2=A0 =C2=A0 </dependency>
+=C2=A0 =C2=A0 <dependency>
+=C2=A0 =C2=A0 =C2=A0 <groupId>org.springframework.boot</grou= pId>
+=C2=A0 =C2=A0 =C2=A0 <artifactId>spring-boot</artifactId>=
+=C2=A0 =C2=A0 =C2=A0 <version>${springbootVersion}</version&= gt;
+=C2=A0 =C2=A0 =C2=A0 <scope>compile</scope>
+=C2=A0 =C2=A0 </dependency>
+
+=C2=A0 =C2=A0 <dependency>
+=C2=A0 =C2=A0 =C2=A0 <groupId>org.springframework.boot</grou= pId>
+=C2=A0 =C2=A0 =C2=A0 <artifactId>spring-boot-starter-test</a= rtifactId>
+=C2=A0 =C2=A0 =C2=A0 <version>${springbootVersion}</version&= gt;
+=C2=A0 =C2=A0 =C2=A0 <scope>test</scope>
+=C2=A0 =C2=A0 </dependency>
+=C2=A0 </dependencies>
+
+</project>
\ No newline at end of file

http:= //git-wip-us.apache.org/repos/asf/logging-log4j-boot/blob/3619ca0= c/spring/src/main/java/org/apache/logging/log4j/boot/spring/AutoC= onfiguringLoggerContextFactory.java
-----------------------------------------------------------------= -----
diff --git a/spring/src/main/java/org/apache/logging/log4j/boot/spring= /AutoConfiguringLoggerContextFactory.java b/spring/src/main/java/= org/apache/logging/log4j/boot/spring/AutoConfiguringLoggerContext= Factory.java
new file mode 100644
index 0000000..706f1db
--- /dev/null
+++ b/spring/src/main/java/org/apache/logging/log4j/boot/spring/A= utoConfiguringLoggerContextFactory.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.=C2=A0 See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.=C2=A0 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.=C2=A0 You may obtain a copy of the License at
+ *
+ *=C2=A0 =C2=A0http://www.apache.org/licenses/LICEN= SE-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.=C2=A0 See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.logging.log4j.boot.spring;
+
+import org.apache.logging.log4j.core.impl.Log4jContextFactory;
+import org.springframework.boot.logging.LoggingSystem;
+
+/**
+ * LoggerContextFactory extension to automatically register logging system= s.
+ */
+public class AutoConfiguringLoggerContextFactory extends Log4jContext= Factory {
+
+=C2=A0 =C2=A0 static {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 System.setProperty("java.util.loggin= g.manager", "org.apache.logging.log4j.jul.LogManager");=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 System.setProperty(LoggingSystem.SYSTEM_P= ROPERTY, Log4jLoggingSystem.class.getName());
+=C2=A0 =C2=A0 }
+
+}

http://git-wip-us.apac= he.org/repos/asf/logging-log4j-boot/blob/3619ca0c/spring/src/main= /java/org/apache/logging/log4j/boot/spring/Log4jLoggingSystem.java
-----------------------------------------------------------------= -----
diff --git a/spring/src/main/java/org/apache/logging/log4j/boot/spring= /Log4jLoggingSystem.java b/spring/src/main/java/org/apache/loggin= g/log4j/boot/spring/Log4jLoggingSystem.java
new file mode 100644
index 0000000..e0bad83
--- /dev/null
+++ b/spring/src/main/java/org/apache/logging/log4j/boot/spring/L= og4jLoggingSystem.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.=C2=A0 See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.=C2=A0 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.=C2=A0 You may obtain a copy of the License at
+ *
+ *=C2=A0 =C2=A0http://www.apache.org/licenses/LICEN= SE-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.=C2=A0 See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.logging.log4j.boot.spring;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.Logger;
+import org.apache.logging.log4j.core.LoggerContext;
+import org.apache.logging.log4j.core.config.ConfigurationFactory;
+import org.apache.logging.log4j.core.config.LoggerConfig;
+import org.apache.logging.log4j.core.config.plugins.util.PluginManager;
+import org.apache.logging.log4j.core.config.plugins.util.PluginType;
+import org.apache.logging.log4j.core.util.NetUtils;
+import org.apache.logging.log4j.core.util.ReflectionUtil;
+import org.apache.logging.log4j.core.util.Throwables;
+import org.apache.logging.log4j.util.Strings;
+import org.springframework.boot.logging.AbstractLoggingSystem;
+import org.springframework.boot.logging.LogFile;
+import org.springframework.boot.logging.LogLevel;
+import org.springframework.boot.logging.LoggingInitializationContext;
+
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Spring Boot LoggingSystem for integration with Log4j 2.
+ */
+public class Log4jLoggingSystem extends AbstractLoggingSystem {
+
+=C2=A0 =C2=A0 static {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Method factoryIsActive;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Method factorySupportedTypes;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 try {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 factoryIsActive =3D Configuratio= nFactory.class.getDeclaredMethod("isActive");
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ReflectionUtil.makeAccessible(factoryIsActive);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 factorySupportedTypes =3D Config= urationFactory.class.getDeclaredMethod("getSupportedTypes&qu= ot;);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ReflectionUtil.makeAccessible(factorySupportedTypes);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 } catch (final NoSuchMethodException e) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Throwables.rethrow(e);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // unreachable; make the compile= r happy
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 factoryIsActive =3D null;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 factorySupportedTypes =3D null;<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 FACTORY_IS_ACTIVE =3D factoryIsActive;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 FACTORY_SUPPORTED_TYPES =3D factorySupportedTy= pes;
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 private static final Method FACTORY_IS_ACTIVE;
+=C2=A0 =C2=A0 private static final Method FACTORY_SUPPORTED_TYPES;
+
+=C2=A0 =C2=A0 private final String[] standardConfigLocations;
+=C2=A0 =C2=A0 private LoggerContext loggerContext;
+
+=C2=A0 =C2=A0 public Log4jLoggingSystem(final ClassLoader classLoader) { +=C2=A0 =C2=A0 =C2=A0 =C2=A0 super(classLoader);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 this.standardConfigLocations =3D determineStan= dardConfigLocations();
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 private static String[] determineStandardConfigLocation= s() {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 final List<String> locations =3D new Arr= ayList<>();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 for (final ConfigurationFactory factory : find= Factories()) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for (final String extension : ge= tSupportedTypes(factory)) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ("*".= equals(extension)) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cont= inue;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 locations.add(&quo= t;log4j2-test" + extension);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 locations.add(&quo= t;log4j2" + extension);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return locations.toArray(new String[0]);
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 private static Collection<ConfigurationFactory> f= indFactories() {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 final PluginManager manager =3D new PluginMana= ger(ConfigurationFactory.CATEGORY);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 manager.collectPlugins();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 final Collection<ConfigurationFactory&= gt; factories =3D new ArrayList<>();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 for (final PluginType<?> type : manager.= getPlugins().values()) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 final ConfigurationFactory facto= ry =3D tryCreateFactory(type);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (factory !=3D null) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 factories.add(fact= ory);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return factories;
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 private static ConfigurationFactory tryCreateFactory(final P= luginType<?> pluginType) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 try {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return pluginType.getPluginClass= ().asSubclass(ConfigurationFactory.class).newInstance();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 } catch (final Exception ignored) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return null;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 private static String[] getSupportedTypes(final Configuratio= nFactory factory) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 try {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((boolean) FACTORY_IS_ACTIVE.= invoke(factory)) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (String[]) = FACTORY_SUPPORTED_TYPES.invoke(factory);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 } catch (final Exception ignored) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return new String[0];
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Override
+=C2=A0 =C2=A0 protected String[] getStandardConfigLocations() {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return standardConfigLocations;
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Override
+=C2=A0 =C2=A0 protected void loadDefaults(final LoggingInitializationConte= xt context, final LogFile file) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 final String configFileName =3D "classpat= h:META-INF/log4j/default/log4j2"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 + ((file =3D=3D null) ? Strings.= EMPTY : "-file")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 + ".xml";
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 loadConfiguration(context, configFileName, fil= e);
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Override
+=C2=A0 =C2=A0 protected void loadConfiguration(final LoggingInitialization= Context context, final String location,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0final LogFile fi= le) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 final URI configLocation =3D NetUtils.toURI(lo= cation);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 loggerContext =3D (LoggerContext) LogManager.g= etContext(
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 getClassLoader(), false, this, c= onfigLocation);
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Override
+=C2=A0 =C2=A0 protected void reinitialize(final LoggingInitializationConte= xt context) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (loggerContext !=3D null) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 loggerContext.reconfigure();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Override
+=C2=A0 =C2=A0 public void cleanUp() {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (loggerContext !=3D null) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 loggerContext.setExternalContext(null);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 loggerContext.terminate();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Override
+=C2=A0 =C2=A0 public void setLogLevel(final String loggerName, final LogLe= vel logLevel) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (loggerContext !=3D null) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 final Logger logger =3D loggerCo= ntext.getLogger(loggerName);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 final LoggerConfig config =3D lo= gger.get();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 final Level level =3D convert(lo= gLevel);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (config.getLevel() !=3D level= ) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 config.setLevel(le= vel);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 private static Level convert(final LogLevel logLevel) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 switch (logLevel) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case FATAL:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.FATAL= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case ERROR:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.ERROR= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case WARN:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.WARN;=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case INFO:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.INFO;=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case DEBUG:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.DEBUG= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case TRACE:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.TRACE= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 case OFF:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.OFF;<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 default:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return Level.toLev= el(logLevel.name());
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0 =C2=A0 }
+}

http://git-wip-us.apache.org/repos= /asf/logging-log4j-boot/blob/3619ca0c/spring/src/main/resources/M= ETA-INF/log4j/default/log4j2-file.xml
-----------------------------------------------------------------= -----
diff --git a/spring/src/main/resources/META-INF/log4j/default/log4j2-f= ile.xml b/spring/src/main/resources/META-INF/log4j/default/log4j2= -file.xml
new file mode 100644
index 0000000..9880ceb
--- /dev/null
+++ b/spring/src/main/resources/META-INF/log4j/default/log4j2-fil= e.xml
@@ -0,0 +1,57 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<!--
+=C2=A0 ~ Licensed to the Apache Software Foundation (ASF) under one
+=C2=A0 ~ or more contributor license agreements.=C2=A0 See the NOTICE file=
+=C2=A0 ~ distributed with this work for additional information
+=C2=A0 ~ regarding copyright ownership.=C2=A0 The ASF licenses this file +=C2=A0 ~ to you under the Apache License, Version 2.0 (the
+=C2=A0 ~ "License"); you may not use this file except in complia= nce
+=C2=A0 ~ with the License.=C2=A0 You may obtain a copy of the License at +=C2=A0 ~
+=C2=A0 ~=C2=A0 =C2=A0http://www.apache.org/licenses/= LICENSE-2.0
+=C2=A0 ~
+=C2=A0 ~ Unless required by applicable law or agreed to in writing,
+=C2=A0 ~ software distributed under the License is distributed on an
+=C2=A0 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY<= br> +=C2=A0 ~ KIND, either express or implied.=C2=A0 See the License for the +=C2=A0 ~ specific language governing permissions and limitations
+=C2=A0 ~ under the License.
+=C2=A0 -->
+
+<Configuration status=3D"WARN">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<Properties>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"PID">????</Property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"LOG_EXCEPTION_CONVERSION_WORD">%xEx</Property><= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"LOG_LEVEL_PATTERN">%5p</Property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_= PATTERN} ${sys:PID} --- [%t] %-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVER<= wbr>SION_WORD}</Property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0</Properties>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<Appenders>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Console name=3D= "Console" target=3D"SYSTEM_OUT" follow=3D"true&quo= t;>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<PatternLayout pattern=3D"${LOG_PATTERN}" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</Console> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<RollingFile nam= e=3D"File" fileName=3D"${sys:LOG_FILE}" filePattern=3D&= quot;logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz"&= gt;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<PatternLayout pattern=3D"${LOG_PATTERN}"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<Policies>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<SizeBasedTriggeringPolicy size=3D= "10 MB" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0</Policies>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</RollingFile>= ;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0</Appenders>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<Loggers>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.catalina.startup.DigesterFactory" level=3D"e= rror" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.catalina.util.LifecycleBase" level=3D"error&= quot; />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.coyote.http11.Http11NioProtocol" level=3D"wa= rn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.apache.sshd.common.util.SecurityUtils" level=3D"war= n"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.tomcat.util.net.NioSelectorPool" level=3D"wa= rn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.crsh.plugin" level=3D"warn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.crsh.ssh" level=3D"warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.eclipse.jetty.util.component.AbstractLifeCycle" level=3D= "error" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.hibernate.validator.internal.util.Version" level=3D"= ;warn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.springframework.boot.actuate.autoconfigure.CrshAutoConfi= guration" level=3D"warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.springframework.boot.actuate.endpoint.jmx" level=3D"= ;warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.thymeleaf" level=3D"warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Root level=3D&q= uot;info">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<AppenderRef ref=3D"Console" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<AppenderRef ref=3D"File" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</Root>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0</Loggers>
+</Configuration>

http://git-wip-us.apache.org/repos/asf/= logging-log4j-boot/blob/3619ca0c/spring/src/main/resources/META-I= NF/log4j/default/log4j2.xml
-----------------------------------------------------------------= -----
diff --git a/spring/src/main/resources/META-INF/log4j/default/log4j2.x= ml b/spring/src/main/resources/META-INF/log4j/default/log4j2.xml
new file mode 100644
index 0000000..2ede5aa
--- /dev/null
+++ b/spring/src/main/resources/META-INF/log4j/default/log4j2.xml=
@@ -0,0 +1,50 @@
+<?xml version=3D"1.0" encoding=3D"UTF-8"?>
+<!--
+=C2=A0 ~ Licensed to the Apache Software Foundation (ASF) under one
+=C2=A0 ~ or more contributor license agreements.=C2=A0 See the NOTICE file=
+=C2=A0 ~ distributed with this work for additional information
+=C2=A0 ~ regarding copyright ownership.=C2=A0 The ASF licenses this file +=C2=A0 ~ to you under the Apache License, Version 2.0 (the
+=C2=A0 ~ "License"); you may not use this file except in complia= nce
+=C2=A0 ~ with the License.=C2=A0 You may obtain a copy of the License at +=C2=A0 ~
+=C2=A0 ~=C2=A0 =C2=A0http://www.apache.org/licenses/= LICENSE-2.0
+=C2=A0 ~
+=C2=A0 ~ Unless required by applicable law or agreed to in writing,
+=C2=A0 ~ software distributed under the License is distributed on an
+=C2=A0 ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY<= br> +=C2=A0 ~ KIND, either express or implied.=C2=A0 See the License for the +=C2=A0 ~ specific language governing permissions and limitations
+=C2=A0 ~ under the License.
+=C2=A0 -->
+
+<Configuration status=3D"WARN">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<Properties>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"PID">????</Property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"LOG_EXCEPTION_CONVERSION_WORD">%xEx</Property><= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"LOG_LEVEL_PATTERN">%5p</Property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Property name= =3D"LOG_PATTERN">%style{%d{yyyy-MM-dd HH:mm:ss.SSS}}{dim}= %highlight{${LOG_LEVEL_PATTERN}} %style{${sys:PID}}{magenta} %style{-= --}{dim} %style{[%15.15t]}{dim} %style{%-40.40c{1.}}{cyan} %style{:}{faint}= %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0</Properties>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<Appenders>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Console name=3D= "Console" target=3D"SYSTEM_OUT" follow=3D"true&quo= t;>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<PatternLayout pattern=3D"${LOG_PATTERN}" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</Console> +=C2=A0 =C2=A0 =C2=A0 =C2=A0</Appenders>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0<Loggers>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.catalina.startup.DigesterFactory" level=3D"e= rror" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.catalina.util.LifecycleBase" level=3D"error&= quot; />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.coyote.http11.Http11NioProtocol" level=3D"wa= rn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.apache.sshd.common.util.SecurityUtils" level=3D"war= n"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.apache.tomcat.util.net.NioSelectorPool" level=3D"wa= rn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.crsh.plugin" level=3D"warn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.crsh.ssh" level=3D"warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.eclipse.jetty.util.component.AbstractLifeCycle" level=3D= "error" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Logger name=3D&= quot;org.hibernate.validator.internal.util.Version" level=3D"= ;warn" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.springframework.boot.actuate.autoconfigure.CrshAutoConfi= guration" level=3D"warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.springframework.boot.actuate.endpoint.jmx" level=3D"= ;warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<logger name=3D&= quot;org.thymeleaf" level=3D"warn"/>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Root level=3D&q= uot;info">
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0<AppenderRef ref=3D"Console" />
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</Root>
+=C2=A0 =C2=A0 =C2=A0 =C2=A0</Loggers>
+</Configuration>

http://git-wip-us.apache.org/repos/asf/loggin= g-log4j-boot/blob/3619ca0c/spring/src/main/resources/log4j2.compo= nent.properties
-----------------------------------------------------------------= -----
diff --git a/spring/src/main/resources/log4j2.component.properties b/s= pring/src/main/resources/log4j2.component.properties
new file mode 100644
index 0000000..34d00f4
--- /dev/null
+++ b/spring/src/main/resources/log4j2.component.properties
@@ -0,0 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.=C2=A0 See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.=C2=A0 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.=C2=A0 You may obtain a copy of the License at
+#
+#=C2=A0 =C2=A0http://www.apache.org/licenses/LICEN= SE-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.=C2=A0 See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+log4j2.loggerContextFactory =3D org.apache.logging.log4j.boot.spring.= AutoConfiguringLoggerContextFactory
\ No newline at end of file

http://git-wip-us.= apache.org/repos/asf/logging-log4j-boot/blob/3619ca0c/spring/src/= test/java/org/apache/logging/log4j/boot/spring/LoggingInitializer= Test.java
-----------------------------------------------------------------= -----
diff --git a/spring/src/test/java/org/apache/logging/log4j/boot/spring= /LoggingInitializerTest.java b/spring/src/test/java/org/apache/lo= gging/log4j/boot/spring/LoggingInitializerTest.java
new file mode 100644
index 0000000..b7002f3
--- /dev/null
+++ b/spring/src/test/java/org/apache/logging/log4j/boot/spring/L= oggingInitializerTest.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.=C2=A0 See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.=C2=A0 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.=C2=A0 You may obtain a copy of the License at
+ *
+ *=C2=A0 =C2=A0http://www.apache.org/licenses/LICEN= SE-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.=C2=A0 See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.logging.log4j.boot.spring;
+
+import org.apache.commons.logging.LogFactory;
+import org.apache.logging.log4j.jcl.LogFactoryImpl;
+import org.apache.logging.slf4j.Log4jLoggerFactory;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.ILoggerFactory;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.logging.LogManager;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Integration test to verify Spring Boot uses the proper logging facades.=
+ */
+@RunWith(SpringRunner.class)
+@SpringBootApplication
+@SpringBootTest
+public class LoggingInitializerTest {
+
+=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 public void testJavaUtilLogManagerSet() throws Throwable { +=C2=A0 =C2=A0 =C2=A0 =C2=A0 LogManager logManager =3D LogManager.getLogMan= ager();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(logManager).isInstanceOf(org.a= pache.logging.log4j.jul.LogManager.class);
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 public void testCommonsLogFactorySet() throws Throwable { +=C2=A0 =C2=A0 =C2=A0 =C2=A0 LogFactory logFactory =3D LogFactory.getFactor= y();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(logFactory).isInstanceOf(LogFa= ctoryImpl.class);
+=C2=A0 =C2=A0 }
+
+=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 public void testSlf4jFactorySet() throws Exception {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 ILoggerFactory factory =3D LoggerFactory.getIL= oggerFactory();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(factory).isInstanceOf(Log4jLog= gerFactory.class);
+=C2=A0 =C2=A0 }
+}
\ No newline at end of file




--
Matt Sicker &= lt;boards@gmail.com>




--
--001a114b79a430da03054618fdb8--