Fixes https://github.com/hazelcast/hazelcast/issues/19668

Hazelcast will use slf4j as a default logging type when SLF4J is detected on the classpath.

Otherwise, Hazelcast shutdown logs are missing. It seems it's caused by a bug in JDK - jul's LogManager resets the loggers on shutdown, running concurrently with other shutdown hooks it is not deterministic what runs first and we may or may not see the logs in the configuration using jul see JDK-8161253 and JDK-8029834.

Before:

2022-08-29T12:47:34.822+02:00  INFO 2312 --- [.ShutdownThread] com.hazelcast.instance.impl.Node         : [192.168.0.42]:5701 [dev] [5.1.2] Running shutdown hook... Current state: ACTIVE

After:

2022-08-29T12:49:21.111+02:00  INFO 2378 --- [.ShutdownThread] com.hazelcast.instance.impl.Node         : [192.168.0.42]:5701 [dev] [5.1.2] Running shutdown hook... Current state: ACTIVE
2022-08-29T12:49:21.111+02:00  INFO 2378 --- [.ShutdownThread] com.hazelcast.core.LifecycleService      : [192.168.0.42]:5701 [dev] [5.1.2] [192.168.0.42]:5701 is SHUTTING_DOWN
2022-08-29T12:49:21.115+02:00  WARN 2378 --- [.ShutdownThread] com.hazelcast.instance.impl.Node         : [192.168.0.42]:5701 [dev] [5.1.2] Terminating forcefully...
2022-08-29T12:49:21.116+02:00  INFO 2378 --- [.ShutdownThread] com.hazelcast.instance.impl.Node         : [192.168.0.42]:5701 [dev] [5.1.2] Shutting down connection manager...
2022-08-29T12:49:21.119+02:00  INFO 2378 --- [.ShutdownThread] com.hazelcast.instance.impl.Node         : [192.168.0.42]:5701 [dev] [5.1.2] Shutting down node engine...
2022-08-29T12:49:21.139+02:00  INFO 2378 --- [.ShutdownThread] c.hazelcast.instance.impl.NodeExtension  : [192.168.0.42]:5701 [dev] [5.1.2] Destroying node NodeExtension.
2022-08-29T12:49:21.140+02:00  INFO 2378 --- [.ShutdownThread] com.hazelcast.instance.impl.Node         : [192.168.0.42]:5701 [dev] [5.1.2] Hazelcast Shutdown is completed in 25 ms.
2022-08-29T12:49:21.140+02:00  INFO 2378 --- [.ShutdownThread] com.hazelcast.core.LifecycleService      : [192.168.0.42]:5701 [dev] [5.1.2] [192.168.0.42]:5701 is SHUTDOWN

Reference documentation: https://docs.hazelcast.com/hazelcast/5.1/maintain-cluster/logging

Comment From: pivotal-cla

@ldziedziul Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@ldziedziul Thank you for signing the Contributor License Agreement!

Comment From: ldziedziul

FYI @frant-harm

Comment From: snicoll

@ldziedziul thank you for making your first contribution to Spring Boot.