Hazelcast Diagnostics Log Clean Up

150 views
Skip to first unread message

Shivi Garg

unread,
Jan 19, 2020, 9:56:37 PM1/19/20
to Hazelcast
Hi,

we are using hazelcast diagnostics logs in our solution. we have configured below properties in our application:

Diagnostics.MAX_ROLLED_FILE_SIZE_MB with value 5
Diagnostics.MAX_ROLLED_FILE_COUNT with value 5

After this, diagnostics log file roll over is working fine for a particular filename.

example: if my host ip is 10.39.40.175, port is 5701, and hazelcast started on timestamp 1577772553220, then diagnostics-10.39.40.175_5701-1577772553220 file name will be used with indexes 000,001, and so on, and accordingly rollover will be applied.

But, if we restart hazelcast multiple times, then each different filename is used for diagnostics logs file, as timestamp is changed. Then rollover doesn't work, And the number of diagnostics logs file keep growing and clean up does not happen.

Is there any other configuration for logs clean up? How can we achieve it?

Thanks,
Shivi Garg 

Shivi Garg

unread,
Jan 31, 2020, 12:19:56 AM1/31/20
to Hazelcast
Can anybody please help??

Vassilis Bekiaris

unread,
Jan 31, 2020, 3:09:27 AM1/31/20
to Hazelcast
Hi Shivi,

I don't think you can achieve the directory clean up with configuration; the rollover works (as you noticed) for the currently active diagnostics file. As a workaround you can incorporate the directory cleanup in your startup script before hazelcast starts. In any case, feel free to create a feature request at https://github.com/hazelcast/hazelcast/issues/new/choose or, if you feel like it, contribute a patch.

Cheers!
Vassilis

Shivi Garg

unread,
Feb 6, 2020, 11:51:41 PM2/6/20
to Hazelcast
Thank you, Vassilis.

I have a further query:

Is there a way to use logback.xml to control diagnostics logs formatting and roll-over mechanism?

Thanks,
Shivi Garg


On Monday, 20 January 2020 08:26:37 UTC+5:30, Shivi Garg wrote:

Vassilis Bekiaris

unread,
Feb 7, 2020, 2:18:45 AM2/7/20
to haze...@googlegroups.com
Hi Shivi,

no, we are not using a logger for diagnostics, rollover and output are managed directly by Hazelcast in Diagnostics (https://github.com/hazelcast/hazelcast/blob/97ff57ba92dc1fbfa77720885e7db40757999080/hazelcast/src/main/java/com/hazelcast/internal/diagnostics/Diagnostics.java#L44)  and associated classes.

Cheers!
Vassilis

-- 
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/c1085ee5-11dd-45e5-821a-b64f47c1e769%40googlegroups.com.

Łukasz Pochodaj

unread,
Nov 22, 2022, 4:14:15 AM11/22/22
to Hazelcast
Hi Shivi.

I came across this topic when googling same problem. They added this feature not long after your question https://github.com/hazelcast/hazelcast/pull/17176.
You can configure roll-over mechanism with logback.xml. Just set property "hazelcast.diagnostics.stdout" to "LOGGER". Odly enough it's not covered in documentation - https://docs.hazelcast.com/imdg/4.2/management/diagnostics .

Regards,
Łukasz

Serdar Ozmen

unread,
Nov 28, 2022, 2:48:18 AM11/28/22
to Hazelcast
Thanks a lot for the notice and information Shivi and Lukasz.
Updated the system properties content accordingly.
We will also update https://docs.hazelcast.com/hazelcast/latest/maintain-cluster/monitoring#diagnostics to include it in more detail.
This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast
Reply all
Reply to author
Forward
0 new messages