Hazelcast logging issue

63 views
Skip to first unread message

karim slaimi

unread,
Jan 12, 2021, 10:15:27 AM1/12/21
to haze...@googlegroups.com
Hello,

I am facing an issue on the Hazelcast logging part.
Actually, I would like to stop using JDK logging and move to log4j logging.
So I did an update on my hazelcast.xml file as bellow:
<properties>
        <property name="hazelcast.logging.type">log4j</property>
        <property name="log4j.configuration">log4j.properties</property>
  </properties>

Then, log4j.properties 's content:

log4j.rootLogger=INFO,file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=hazelcast.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p [%c{1}] - %m%n
log4j.appender.file.maxFileSize=50MB
log4j.appender.file.maxBackupIndex=100
log4j.appender.file.threshold=DEBUG
log4j.logger.com.hazelcast=debug
log4j.logger.com.hazelcast.cluster=debug
#log4j.logger.com.hazelcast.partition=debug
#log4j.logger.com.hazelcast.partition.InternalPartitionService=debug
#log4j.logger.com.hazelcast.nio=debug
#log4j.logger.com.hazelcast.hibernate=debug

I created a hazeIcast.log file
I also added a log4j jar into user-lib folder

But when I start hazelcast, it's not loading any more and so it did not start.

So can you tell me if I am doing something wrong. 
The logging conf seems ok but I am blocked at this step since Hazelcast won't start any more.

Best regards
Karim

Rafal Leszko

unread,
Jan 13, 2021, 3:20:08 AM1/13/21
to haze...@googlegroups.com
Hi Karim,

To use Log4j you need to do the following steps:
1. Have Log4j Jar into your classpath
2. Update Hazelcast configuration to use Log4j (your configuration looks ok)
3. Have proper log4 configuration (your log4j.properties looks correct, but you can compare it to this one)

We use log4j in our Docker image, so you can check and compare your configuration to the one from our Docker image.

Hope it helps,
Rafał

--
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/CAHSeLL0KnkL1o-HkyOi%2BukKBZC3e9SWYHpkRbXLUAUrq4m3iHA%40mail.gmail.com.


--

Rafał Leszko
Software Engineer
   hazelcast®
 
 


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

karim slaimi

unread,
Jan 13, 2021, 9:33:56 AM1/13/21
to haze...@googlegroups.com
Hello,

Thank you for your quick response.

I checked my configuration twice. I really followed the documentation but it is still not working.
However, since I am using the free version, can you tell me if the logging (log4j and slf4j) is available in the Hazelcast free version?  Or is it available on enterprise version only? JDK logging only is available in the free version?

Best regards
Karim

Rafal Leszko

unread,
Jan 13, 2021, 9:36:19 AM1/13/21
to haze...@googlegroups.com
Hi Karim,

Logging is a free (open source) feature, so it should work correctly.

Cheers,
Rafał

Reply all
Reply to author
Forward
0 new messages