diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 0ba7242a2c..f0459f32ed 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -125,7 +125,7 @@ 4.12 5.0.0.Beta1 3.5.3 - 2.7 + 2.8.2 1.2.3 1.16.16 1.5.9 diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverter.java b/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverter.java index 80856d51ed..19ec4c5aa8 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverter.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2017 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. @@ -17,6 +17,7 @@ package org.springframework.boot.logging.log4j2; import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.pattern.ConverterKeys; import org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter; @@ -38,9 +39,11 @@ public final class ExtendedWhitespaceThrowablePatternConverter private final ExtendedThrowablePatternConverter delegate; - private ExtendedWhitespaceThrowablePatternConverter(String[] options) { - super("WhitespaceExtendedThrowable", "throwable", options); - this.delegate = ExtendedThrowablePatternConverter.newInstance(options); + private ExtendedWhitespaceThrowablePatternConverter(Configuration configuration, + String[] options) { + super("WhitespaceExtendedThrowable", "throwable", options, configuration); + this.delegate = ExtendedThrowablePatternConverter.newInstance(configuration, + options); } @Override @@ -54,13 +57,14 @@ public final class ExtendedWhitespaceThrowablePatternConverter /** * Creates a new instance of the class. Required by Log4J2. + * @param configuration current configuration * @param options pattern options, may be null. If first element is "short", only the * first line of the throwable will be formatted. * @return a new {@code WhitespaceThrowablePatternConverter} */ public static ExtendedWhitespaceThrowablePatternConverter newInstance( - String[] options) { - return new ExtendedWhitespaceThrowablePatternConverter(options); + Configuration configuration, String[] options) { + return new ExtendedWhitespaceThrowablePatternConverter(configuration, options); } } diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverter.java b/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverter.java index 6fde11dce0..221c1727fa 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverter.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2017 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. @@ -17,6 +17,7 @@ package org.springframework.boot.logging.log4j2; import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.pattern.ConverterKeys; import org.apache.logging.log4j.core.pattern.PatternConverter; @@ -33,8 +34,9 @@ import org.apache.logging.log4j.core.pattern.ThrowablePatternConverter; @ConverterKeys({ "wEx", "wThrowable", "wException" }) public final class WhitespaceThrowablePatternConverter extends ThrowablePatternConverter { - private WhitespaceThrowablePatternConverter(String[] options) { - super("WhitespaceThrowable", "throwable", options); + private WhitespaceThrowablePatternConverter(Configuration configuration, + String[] options) { + super("WhitespaceThrowable", "throwable", options, configuration); } @Override @@ -48,12 +50,14 @@ public final class WhitespaceThrowablePatternConverter extends ThrowablePatternC /** * Creates a new instance of the class. Required by Log4J2. + * @param configuration current configuration * @param options pattern options, may be null. If first element is "short", only the * first line of the throwable will be formatted. * @return a new {@code WhitespaceThrowablePatternConverter} */ - public static WhitespaceThrowablePatternConverter newInstance(String[] options) { - return new WhitespaceThrowablePatternConverter(options); + public static WhitespaceThrowablePatternConverter newInstance( + Configuration configuration, String[] options) { + return new WhitespaceThrowablePatternConverter(configuration, options); } } diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverterTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverterTests.java index 18df7ee924..f576e4c5df 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverterTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/ExtendedWhitespaceThrowablePatternConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. @@ -17,6 +17,7 @@ package org.springframework.boot.logging.log4j2; import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.DefaultConfiguration; import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.core.pattern.ThrowablePatternConverter; import org.junit.Test; @@ -34,7 +35,7 @@ public class ExtendedWhitespaceThrowablePatternConverterTests { private static final String LINE_SEPARATOR = System.getProperty("line.separator"); private final ThrowablePatternConverter converter = ExtendedWhitespaceThrowablePatternConverter - .newInstance(new String[] {}); + .newInstance(new DefaultConfiguration(), new String[] {}); @Test public void noStackTrace() throws Exception { diff --git a/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverterTests.java b/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverterTests.java index 5c386fc355..48069e998e 100644 --- a/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverterTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/WhitespaceThrowablePatternConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. @@ -17,6 +17,7 @@ package org.springframework.boot.logging.log4j2; import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.config.DefaultConfiguration; import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.core.pattern.ThrowablePatternConverter; import org.junit.Test; @@ -33,7 +34,7 @@ public class WhitespaceThrowablePatternConverterTests { private static final String LINE_SEPARATOR = System.getProperty("line.separator"); private final ThrowablePatternConverter converter = WhitespaceThrowablePatternConverter - .newInstance(new String[] {}); + .newInstance(new DefaultConfiguration(), new String[] {}); @Test public void noStackTrace() throws Exception {