vertx clustered mode hazelcast log config on linux
Asked Answered
C

1

0

Using Eclipse on Windows, a vertx Verticle with a misconfigured cluster.xml shows the following error in the Eclipse console:

11:46:18.536 [hz._hzInstance_1_dev.generic-operation.thread-0] ERROR com.hazelcast.cluster - [192.168.25.8]:5701 [dev] [3.5.2] Node could not join cluster. A Configuration mismatch was detected: Incompatible joiners! expected: multicast, found: tcp-ip Node is going to shutdown now!
11:46:22.529 [vert.x-worker-thread-0] ERROR com.hazelcast.cluster.impl.TcpIpJoiner - [192.168.25.8]:5701 [dev] [3.5.2] com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is not active!

This is fine, I know to reconfigure the cluster for multicast. The problem is when I deploy the same code and configuration to Linux, and run it as a fat jar then the same log doesn't show either the hz thread or the vertx worker thread logs. Instead it shows the verticle logs as:

2015-11-05 12:03:09,329 Starting clustered Vertx
2015-11-05 12:03:13,549 ERROR: VerticleService failed to start: java.lang.NullPointerException

So if I run on Linux the log to tell me there's a misconfiguration isn't showing. There's something I am missing in the vertx / maven log config but I don't know what. Maven properties are as follows:

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <exec.mainClass>main.java.eiger.isct.service.Verticle</exec.mainClass>
  <log4j.configurationFile>log4j2.xml</log4j.configurationFile>
  <hazelcast.logging.type>log4j2</hazelcast.logging.type>
</properties>

and I start the fat jar using:

java -Dlog4j.configuration=log4j2.xml -jar Verticle-0.5-SNAPSHOT-fat.jar

How can I get the hz thread and vertx thread to log on Linux?

I've tried adding a vertx-default-jul-logging.properties file below to the maven resources dir but no luck.

com.hazelcast.level=ALL
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.FileHandler.level=ALL

THANKS for your comment.

Calci answered 5/11, 2015 at 12:26 Comment(2)
I haven't used Vert.x from within Maven, but when using it in Openshift the right filename is logging.properties. Though it is with Vert.x 2 and I don't know if it changes in Vert.x 3 github.com/vert-x/openshift-cartridge/tree/master/versions/…Osteoblast
Also, it is placed in the same folder as cluster.xml fileOsteoblast
C
0

Vertx has started logging having added

-Djava.util.logging.config.file=../logging.properties

to the java start command and with the default logging.properties like (and this is a nice config for lower level stuff):

handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS:%1$tL %4$s %2$s %5$s%6$s%n
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.FileHandler.level=ALL
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern=../logs/vertx.log

.level=ALL
io.vertx.level=ALL
com.hazelcast.level=ALL
io.netty.util.internal.PlatformDependent.level=ALL

and vertx is logging to ../logs/vertx.log on Linux

Calci answered 6/11, 2015 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.