Keep Health Check output out of main server.log?

120 views
Skip to first unread message

Ulrich Mayring

unread,
Apr 5, 2017, 4:10:47 AM4/5/17
to Payara Forum
Hello,

I have just tested the health check service as detailed under http://blog.payara.fish/the-health-check-service-in-depth-payara-server and now I wonder whether it is possible to send the output to another log file, to keep the main server.log clean?

Also, for monitoring purposes a local log file isn't ideal, does anyone have a solution for remotely monitoring Payara's health?

Ulrich

Ondrej Mihályi

unread,
Apr 5, 2017, 11:08:57 AM4/5/17
to Payara Forum
Hi Ulrich,

You have a couple of options here.

Although it's not possible to send output of the log notifier to a different file, you can disable the default log notifier in the Notification Service and enable an alternative notifier to receive notifications about healthcheck threshold breaches e.g. via an email (SMTP) or JMS. The documentation about available notifiers can be found here: https://payara.gitbooks.io/payara-server/content/documentation/extended-documentation/notification-service/notifiers.html
If none of the built-in notifiers fits your monitoring tool, you should be able to use JMS to route notifications messages to your custom receiver, which would then send the notifications to your monitoring tool.

If you can bear with notifications ending up in the log file, you can use LogStash to parse the log files and send the information to your monitoring system. There is a nice series of blog posts how to setup LogStash + Elastic Search + Kibana with Payara Server: http://blog.payara.fish/payara-servers-monitoring-service-part-2-integrating-with-logstash-and-elasticsearch

One thing to remind: The healthcheck service is a higher level monitoring tool in Payara Server - it monitors the server itself and only sends notifications (alerts) when one of the metrics is breached. If all is OK, nothing is sent.

You can also monitor lower level Payara Server metrics via JMX or REST interface - you can find a lot of info about setting up monitoring in this administration guide: http://info.payara.fish/advanced-administration-maintenance-of-payara-server-guide
In short, if you enable monitoring of the JVM module, you should be able to follow most of the metrics being evaluated by the Healthcheck Service via this REST endpoint: http://localhost:4848/monitoring/domain/server/jvm

Regards,
Ondrej

Dňa streda, 5. apríla 2017 10:10:47 UTC+2 Ulrich Mayring napísal(-a):

Ulrich Mayring

unread,
Apr 6, 2017, 8:21:44 AM4/6/17
to Payara Forum
I'm sorry, I forgot to mention that I'm using Payara Micro here. So the monitoring URL and JMX don't work there. Basically, the idea is to split log output and health check output. But if I understand you correctly, I can only redirect the entire output here or there, but I can't split between them.

It would be nice to have the monitoring output go to the Hazelcast event bus, but there are no docs for this option yet.

Ulrich

Ondrej Mihályi

unread,
Apr 7, 2017, 4:44:36 AM4/7/17
to Ulrich Mayring, Payara Forum
Hi Ulrich,

I just realized that it's possible to configure the logging system so that some loggers output messages to another file. You would need to configure the JVM logger, by passing alternative configuration via --logproperties Payara Micro argument. This would overwrite any Payara Micro configuration, so the best thing to do is to extract the bundled logging.propertes file from the Payara Micro JAR, which can be found in MICRO-INF/domain/logging.properties and modify it.  In 171, the Healthcheck service logs events via the Notification service, therefore the logger used to output the messages to the log is called fish.payara.nucleus.notification.service.LogNotifierService, which is different than the logger described in the blog post, which is older than 171 version.

It would be nice to have the monitoring output go to the Hazelcast event bus, but there are no docs for this option yet.

We have added the CDI (Hazelcast) bus notifier, but we found out it's not yet stable enough, therefore we decided not to document it yet. I hope that all issues will be fixed in 172 and then we will also add the documentation, and probably also a blog post how to use it. We also plan to add a plain CDI event notifier, which would be triggered only on a local instance even without hazelcast enabled.

With 171, the only stable option to customize handling of notifications is the JMS notifier, but JMS is not yet available in Payara Micro. It will be available in 172 (here are some details: https://github.com/payara/Payara/pull/1505)

Ondrej


--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/b9aabc31-38f3-4800-bb4a-d0e79beecaf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Croft

unread,
Apr 15, 2017, 6:59:59 AM4/15/17
to Payara Forum
I created an internal issue a little while ago for extending the log notifier to be able to log to a named file: PAYARA-1562

For Payara Micro, the JMS notifier will soon become an option. Payara Micro 172 can be used as a JMS client if you deploy a JMS resource adapter to it. As long as you have a JMS broker configured for the resource adapter, you will be able to send and receive JMS from Payara Micro :-)
Reply all
Reply to author
Forward
0 new messages