@@ -159,7 +159,7 @@ void testNonDefaultConfigLocation(CapturedOutput output) {
159
159
assertThat (output ).contains ("Hello world" ).contains (tmpDir () + "/tmp.log" );
160
160
assertThat (new File (tmpDir () + "/tmp.log" )).doesNotExist ();
161
161
assertThat (configuration .getConfigurationSource ().getFile ().getAbsolutePath ())
162
- .contains ("log4j2-nondefault.xml" );
162
+ .contains ("log4j2-nondefault.xml" );
163
163
assertThat (configuration .getWatchManager ().getIntervalSeconds ()).isEqualTo (30 );
164
164
}
165
165
@@ -236,7 +236,7 @@ void getLoggingConfiguration() {
236
236
this .loggingSystem .setLogLevel (getClass ().getName (), LogLevel .DEBUG );
237
237
LoggerConfiguration configuration = this .loggingSystem .getLoggerConfiguration (getClass ().getName ());
238
238
assertThat (configuration )
239
- .isEqualTo (new LoggerConfiguration (getClass ().getName (), LogLevel .DEBUG , LogLevel .DEBUG ));
239
+ .isEqualTo (new LoggerConfiguration (getClass ().getName (), LogLevel .DEBUG , LogLevel .DEBUG ));
240
240
}
241
241
242
242
@ Test
@@ -391,7 +391,7 @@ void getLoggingConfigurationWithResetLevelReturnsNull() {
391
391
this .loggingSystem .setLogLevel ("com.example.test" , LogLevel .DEBUG );
392
392
LoggerConfiguration configuration = this .loggingSystem .getLoggerConfiguration ("com.example.test" );
393
393
assertThat (configuration )
394
- .isEqualTo (new LoggerConfiguration ("com.example.test" , LogLevel .DEBUG , LogLevel .DEBUG ));
394
+ .isEqualTo (new LoggerConfiguration ("com.example.test" , LogLevel .DEBUG , LogLevel .DEBUG ));
395
395
this .loggingSystem .setLogLevel ("com.example.test" , null );
396
396
LoggerConfiguration updatedConfiguration = this .loggingSystem .getLoggerConfiguration ("com.example.test" );
397
397
assertThat (updatedConfiguration ).isNull ();
@@ -402,18 +402,17 @@ void getLoggingConfigurationWithResetLevelWhenAlreadyConfiguredReturnsParentConf
402
402
LoggerContext loggerContext = (LoggerContext ) LogManager .getContext (false );
403
403
this .loggingSystem .beforeInitialize ();
404
404
this .loggingSystem .initialize (this .initializationContext , null , null );
405
- loggerContext .getConfiguration ()
406
- .addLogger ("com.example.test" ,
407
- new LoggerConfig ("com.example.test" , org .apache .logging .log4j .Level .INFO , false ));
405
+ loggerContext .getConfiguration ().addLogger ("com.example.test" ,
406
+ new LoggerConfig ("com.example.test" , org .apache .logging .log4j .Level .INFO , false ));
408
407
this .loggingSystem .setLogLevel ("com.example" , LogLevel .WARN );
409
408
this .loggingSystem .setLogLevel ("com.example.test" , LogLevel .DEBUG );
410
409
LoggerConfiguration configuration = this .loggingSystem .getLoggerConfiguration ("com.example.test" );
411
410
assertThat (configuration )
412
- .isEqualTo (new LoggerConfiguration ("com.example.test" , LogLevel .DEBUG , LogLevel .DEBUG ));
411
+ .isEqualTo (new LoggerConfiguration ("com.example.test" , LogLevel .DEBUG , LogLevel .DEBUG ));
413
412
this .loggingSystem .setLogLevel ("com.example.test" , null );
414
413
LoggerConfiguration updatedConfiguration = this .loggingSystem .getLoggerConfiguration ("com.example.test" );
415
414
assertThat (updatedConfiguration )
416
- .isEqualTo (new LoggerConfiguration ("com.example.test" , LogLevel .WARN , LogLevel .WARN ));
415
+ .isEqualTo (new LoggerConfiguration ("com.example.test" , LogLevel .WARN , LogLevel .WARN ));
417
416
}
418
417
419
418
@ Test
@@ -427,6 +426,7 @@ void log4jLevelsArePropagatedToJul() {
427
426
428
427
this .loggingSystem .initialize (this .initializationContext , null , null );
429
428
java .util .logging .Logger logger = java .util .logging .Logger .getLogger (Log4J2LoggingSystemTests .class .getName ());
429
+ logger .info ("Log to trigger level propagation" );
430
430
assertThat (logger .getLevel ()).isNull ();
431
431
this .loggingSystem .setLogLevel (Log4J2LoggingSystemTests .class .getName (), LogLevel .DEBUG );
432
432
assertThat (logger .getLevel ()).isEqualTo (Level .FINE );
@@ -436,7 +436,7 @@ void log4jLevelsArePropagatedToJul() {
436
436
void shutdownHookIsDisabled () {
437
437
assertThat (
438
438
PropertiesUtil .getProperties ().getBooleanProperty (ShutdownCallbackRegistry .SHUTDOWN_HOOK_ENABLED , true ))
439
- .isFalse ();
439
+ .isFalse ();
440
440
}
441
441
442
442
@ Test
@@ -475,11 +475,9 @@ void initializeAddsSpringEnvironmentPropertySource() {
475
475
void nonFileUrlsAreResolvedUsingLog4J2UrlConnectionFactory () {
476
476
this .loggingSystem .beforeInitialize ();
477
477
assertThatIllegalStateException ()
478
- .isThrownBy (() -> this .loggingSystem .initialize (this .initializationContext ,
479
- "http://localhost:8080/shouldnotwork" , null ))
480
- .havingCause ()
481
- .isInstanceOf (ProtocolException .class )
482
- .withMessageContaining ("http has not been enabled" );
478
+ .isThrownBy (() -> this .loggingSystem .initialize (this .initializationContext ,
479
+ "http://localhost:8080/shouldnotwork" , null ))
480
+ .havingCause ().isInstanceOf (ProtocolException .class ).withMessageContaining ("http has not been enabled" );
483
481
}
484
482
485
483
private String getRelativeClasspathLocation (String fileName ) {
0 commit comments