Skip to content

Hazelcast shutdown logs are not available out-of-the-box#32184

Closed
ldziedziul wants to merge 2 commits intospring-projects:mainfrom
ldziedziul:fix_hazelcast_logging
Closed

Hazelcast shutdown logs are not available out-of-the-box#32184
ldziedziul wants to merge 2 commits intospring-projects:mainfrom
ldziedziul:fix_hazelcast_logging

Conversation

@ldziedziul
Copy link
Copy Markdown
Contributor

@ldziedziul ldziedziul commented Aug 29, 2022

Fixes hazelcast/hazelcast#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

@pivotal-cla
Copy link
Copy Markdown

@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.

@pivotal-cla
Copy link
Copy Markdown

@ldziedziul Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 29, 2022
@ldziedziul
Copy link
Copy Markdown
Contributor Author

FYI @frant-harm

@wilkinsona wilkinsona added this to the 2.6.x milestone Aug 30, 2022
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 30, 2022
@snicoll snicoll modified the milestones: 2.6.x, 2.7.4 Sep 7, 2022
@snicoll snicoll changed the title Fix shutdown logging in Hazelcast Hazelcast shutdown logs are not available out-of-the-box Sep 7, 2022
@snicoll snicoll self-assigned this Sep 7, 2022
snicoll pushed a commit that referenced this pull request Sep 7, 2022
@snicoll snicoll closed this in 74a88cd Sep 7, 2022
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Sep 7, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some Hazelcast log statements missing when used via Spring Boot [HZ-822]

5 participants