It is possible to expose just the HZ "members" line in logging?

11 views
Skip to first unread message

o haya

unread,
Apr 28, 2022, 10:17:34 AM4/28/22
to Hazelcast
Hi,

We use log4j2 logging with our springboot+hazelcast apps, and during startup, HZ outputs the "members" line, e.g.:

[INFO ] 2022-04-19 21:12:08.293 [hz.pdp.generic-operation.thread-1] ClusterService - [dlwsvc01.xxxx.com]:9001 [pdp-dev-[dlwsvc01.xxxx.com:9001, dlwsvc02.xxxx.com:9001]] [4.2.2]
 
Members {size:3, ver:19} [
        Member [dlwsvc02.xxxx.com]:9001 - 8f9ca5a5-5aa7-4bbb-b01b-d4f8229ded11
        Member [192.168.163.152]:9001 - 2f0ac435-e4c2-48b4-abe0-60fad0f4edf6
        Member [dlwsvc01.xxxx.com]:9001 - a2b6f535-c742-4eab-b289-24c501c348ee this
]

That line is "INFO" level, but we have our log4j2.properties set for "warning", so, unless we modify the properties file, we normally never see the above line in the logs, but I think it is really important to have appear as it lets us confirm that the members are who we think they should be.

They don't want to change the default level to "INFO", as they always try to keep log files to the minimum, so is there any way to have the above line appear even with the log level is set to "warning"?

Thanks,
Jim


Nick Pratt

unread,
Apr 28, 2022, 6:04:46 PM4/28/22
to haze...@googlegroups.com
You could log it yourself or enable the specific Hazelcast class that's logging this line to be INFO vs WARN.

N

--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/c4b15152-d63e-47fe-abd3-78bf16fb5f7fn%40googlegroups.com.

Neil Stevenson

unread,
Apr 28, 2022, 6:21:21 PM4/28/22
to Hazelcast
 If it's log4j2 there is also the option of using a custom Rewrite appender

 These call your code, with the intention to mask out sensitive things like CVV and SSN, but you can do what you want

 You "just" need to implement org.apache.logging.log4j.core.appender.rewrite.RewritePolicy
Reply all
Reply to author
Forward
0 new messages