0

My team has recently switched my application's backend logger. So, I added the following lines to my hazelcast.yml

hazelcast:
  properties:
    hazelcast.logging.type: slf4j

Unfortunately, it insists on still attempting to use the Log4j config and gives me the following

Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291) ~[catalina.jar:8.5.28]
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119) ~[catalina.jar:8.5.28]
    at com.hazelcast.logging.Log4jFactory.createLogger(Log4jFactory.java:30) ~[hazelcast-4.2.2.jar:4.2.2]
etc

So, it's ignoring my change to the file. Now, if I set a system property

 -Dhazelcast.logging.type=slf4j

it works fine. Now, I don't want to do this as a system property if I can avoid it. It's just one more thing to remember to configure during deployment. But I simply don't know why the property value is being ignored. Any ideas?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Jason
  • 3,943
  • 12
  • 64
  • 104

1 Answers1

0

Hazelcast uses Java Util Logging by default, so the exception you are getting means that somewhere you configured log4j.

František Hartman
  • 14,436
  • 2
  • 40
  • 60
  • 1
    Also, the `hazelcast.yml` file is read as part of start-up. Any part of Hazelcast logging before the config file is read won't be aware of your specification yet. – Neil Stevenson Jan 26 '22 at 14:07