Skip to content

Commit 437073e

Browse files
authored
Also wrap configuration with a LazyInitializer. (#182)
* In the default flow it is not necessary. But since the DynamicLogLevelConfiguration is also exposed via the protected getConfiguration(), it is recreated on each invocation.
1 parent 26565dc commit 437073e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cf-java-logging-support-servlet/src/main/java/com/sap/hcp/cf/logging/servlet/filter/DynamicLogLevelFilter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ public DynamicLogLevelFilter() {
5656
* use a lambda: {@code () -> config}
5757
*/
5858
public DynamicLogLevelFilter(ConcurrentInitializer<DynamicLogLevelConfiguration> configuration) {
59-
this.configuration = configuration;
59+
this.configuration = new LazyInitializer<DynamicLogLevelConfiguration>() {
60+
61+
@Override
62+
protected DynamicLogLevelConfiguration initialize() throws ConcurrentException {
63+
return configuration.get();
64+
}
65+
};
6066
this.processor = new LazyInitializer<DynamicLogLevelProcessor>() {
6167

6268
@Override

0 commit comments

Comments
 (0)