Hi,

1. are you sure it's a good idea to check the log ? Why not just having a health check service in your app bundles ?

2. You can register a PaxAppender like this:


public class MyLogListener implements PaxAppender {

        public void doAppend(PaxLoggingEvent event) {
                // ...
        }

}

And register this PaxAppender as a service.

NB: according to the messages you sent, I afraid you are creating a "gaz plant". I would recommend to take time to evaluate what you need and your design. If you need, I can help you on this.

Regards
JB

On 28/09/2021 09:29, Andrei Petru Mura wrote:
In my scenario, I try to deploy some bundles in my Karaf server, check the status that everything is working, make some work with the successfully deployed bundles and undeploy them. In order to get the status of work done, I would need a log listener for specific bundles. I see the ideal case to be able to register via JMX a log listener as I like and remove it via JMX as I like. Is this possible?
If yes, can you give me some hints, please?
If not, what other approach would you recommend to me?
N.B. Please note that I need to do this programmatically. Adding appenders in ${karaf.home}/etc/org.ops4j.pax.logging.cfg wouldn't be a solution for me.

Thanks,
Andrei

Reply via email to