hawtio

Hawtio Log collection of multiple Webapps running on same Tomcat


I've running multiple spring boot based camel applications on the same tomcat. In every application, that is deployed to that tomcat, i've placed a bean definition to create a LogbackLogQuery. The problem is, only the last deployed applications log appears in the hawtio log tab. I came across this stackoverflow article: Mulitple camel applications logging to single hawtio, but it seems a little bit outdated and i could not figure out a solution.

I use hawtio-default.war on the same tomcat as the other webapps.

Tomcat: 10.1.19, Spring Boot: 3.2.4, Camel: 4.4.0, Hawtio: 4.0.0

So my question is, is there a way to catch all logs of my deployed spring boot based camel applications in hawtio?


Solution

  • It is an interesting deployment method, but unfortunately currently Hawtio 4.0.0 only expects one Spring Boot application per JVM.

    The problem with the LogbacklogQuery MBean is that unless you separate multiple MBeanServer instances, you cannot use multiple MBean instances with a unique name per JVM. It should be possible to define the multiple MBeans with the names:

    but currently the frontend UI side of the Logs plugin only picks up the first of the MBeans.

    If you can report the issue to the GitHub issues, the Hawtio team can consider an enhancement for it: