LogReaderService Blueprint?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LogReaderService Blueprint?

Brad Johnson
I'm trying to find a good mechanism for intercepting logging events to fire them off to an AMQ queue for consumption elsewhere.  I don't really want to scrape log files for a number of reasons (obvious I think).\

I'm in karaf using AMQ and the Red Hat stack - with many of the items from Fuse but not all.

I had one fairly successful way of doing this which simply implemented the same interface as the Logger itself and when the Logger.getLogger(Class) was called I created a wrapper class that both logged to a file and sent the message via the queue.

But I noticed that there are a number of different mechanisms from camel log component to broker plugin (which I also implemented) and the OSGi LoggerReaderService and Listener and wondered if there's a good example of using that with Blueprint.  Most of the examples I've found are with ol' fashion service trackers and the like.
Reply | Threaded
Open this post in threaded view
|

Re: LogReaderService Blueprint?

Matt Sicker
Can you just use the JMS appender from Log4j 2?

On 3 November 2016 at 13:10, Brad Johnson <[hidden email]> wrote:
I'm trying to find a good mechanism for intercepting logging events to fire them off to an AMQ queue for consumption elsewhere.  I don't really want to scrape log files for a number of reasons (obvious I think).\

I'm in karaf using AMQ and the Red Hat stack - with many of the items from Fuse but not all.

I had one fairly successful way of doing this which simply implemented the same interface as the Logger itself and when the Logger.getLogger(Class) was called I created a wrapper class that both logged to a file and sent the message via the queue.

But I noticed that there are a number of different mechanisms from camel log component to broker plugin (which I also implemented) and the OSGi LoggerReaderService and Listener and wondered if there's a good example of using that with Blueprint.  Most of the examples I've found are with ol' fashion service trackers and the like.



--
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: LogReaderService Blueprint?

Christian Schneider
In reply to this post by Brad Johnson
You should have a look at karaf decanter. 

You can simply combine the log collector and the jms appender.

Christian

2016-11-03 19:10 GMT+01:00 Brad Johnson <[hidden email]>:
I'm trying to find a good mechanism for intercepting logging events to fire them off to an AMQ queue for consumption elsewhere.  I don't really want to scrape log files for a number of reasons (obvious I think).\

I'm in karaf using AMQ and the Red Hat stack - with many of the items from Fuse but not all.

I had one fairly successful way of doing this which simply implemented the same interface as the Logger itself and when the Logger.getLogger(Class) was called I created a wrapper class that both logged to a file and sent the message via the queue.

But I noticed that there are a number of different mechanisms from camel log component to broker plugin (which I also implemented) and the OSGi LoggerReaderService and Listener and wondered if there's a good example of using that with Blueprint.  Most of the examples I've found are with ol' fashion service trackers and the like.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: LogReaderService Blueprint?

Brad Johnson
I'll have to look at those.  The JMS appender sounds promising. I don't know decanter, yet, so can't comment. I have to say one of things I find irritating these days is the explosion of different logging libraries - pax logging, slf4j, log4j, java logging, logback, etc.  While I realize the pax logging is more like a factory than its own logger it seems like juggling bowling balls sometimes just to accomplish something that should be relatively easy. 

I'd looked at paxlogging:camel but I'm not sure if it has been kept up-to-date or not.

On Thu, Nov 3, 2016 at 1:23 PM, Christian Schneider <[hidden email]> wrote:
You should have a look at karaf decanter. 

You can simply combine the log collector and the jms appender.

Christian

2016-11-03 19:10 GMT+01:00 Brad Johnson <[hidden email]>:
I'm trying to find a good mechanism for intercepting logging events to fire them off to an AMQ queue for consumption elsewhere.  I don't really want to scrape log files for a number of reasons (obvious I think).\

I'm in karaf using AMQ and the Red Hat stack - with many of the items from Fuse but not all.

I had one fairly successful way of doing this which simply implemented the same interface as the Logger itself and when the Logger.getLogger(Class) was called I created a wrapper class that both logged to a file and sent the message via the queue.

But I noticed that there are a number of different mechanisms from camel log component to broker plugin (which I also implemented) and the OSGi LoggerReaderService and Listener and wondered if there's a good example of using that with Blueprint.  Most of the examples I've found are with ol' fashion service trackers and the like.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply | Threaded
Open this post in threaded view
|

Re: LogReaderService Blueprint?

Matt Sicker
Most logging libraries delegate the actual logging to log4j, logback, or java.util.logging.

On 3 November 2016 at 13:42, Brad Johnson <[hidden email]> wrote:
I'll have to look at those.  The JMS appender sounds promising. I don't know decanter, yet, so can't comment. I have to say one of things I find irritating these days is the explosion of different logging libraries - pax logging, slf4j, log4j, java logging, logback, etc.  While I realize the pax logging is more like a factory than its own logger it seems like juggling bowling balls sometimes just to accomplish something that should be relatively easy. 

I'd looked at paxlogging:camel but I'm not sure if it has been kept up-to-date or not.

On Thu, Nov 3, 2016 at 1:23 PM, Christian Schneider <[hidden email]> wrote:
You should have a look at karaf decanter. 

You can simply combine the log collector and the jms appender.

Christian

2016-11-03 19:10 GMT+01:00 Brad Johnson <[hidden email]>:
I'm trying to find a good mechanism for intercepting logging events to fire them off to an AMQ queue for consumption elsewhere.  I don't really want to scrape log files for a number of reasons (obvious I think).\

I'm in karaf using AMQ and the Red Hat stack - with many of the items from Fuse but not all.

I had one fairly successful way of doing this which simply implemented the same interface as the Logger itself and when the Logger.getLogger(Class) was called I created a wrapper class that both logged to a file and sent the message via the queue.

But I noticed that there are a number of different mechanisms from camel log component to broker plugin (which I also implemented) and the OSGi LoggerReaderService and Listener and wondered if there's a good example of using that with Blueprint.  Most of the examples I've found are with ol' fashion service trackers and the like.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com




--
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: LogReaderService Blueprint?

Brad Johnson
Matt,
Yeah, but we still have to manage all of that in Maven.  So we end up with a bunch of facades and factories and different mechanics.  Not a major deal just a little peeve of mine.
Brad

On Thu, Nov 3, 2016 at 1:53 PM, Matt Sicker <[hidden email]> wrote:
Most logging libraries delegate the actual logging to log4j, logback, or java.util.logging.

On 3 November 2016 at 13:42, Brad Johnson <[hidden email]> wrote:
I'll have to look at those.  The JMS appender sounds promising. I don't know decanter, yet, so can't comment. I have to say one of things I find irritating these days is the explosion of different logging libraries - pax logging, slf4j, log4j, java logging, logback, etc.  While I realize the pax logging is more like a factory than its own logger it seems like juggling bowling balls sometimes just to accomplish something that should be relatively easy. 

I'd looked at paxlogging:camel but I'm not sure if it has been kept up-to-date or not.

On Thu, Nov 3, 2016 at 1:23 PM, Christian Schneider <[hidden email]> wrote:
You should have a look at karaf decanter. 

You can simply combine the log collector and the jms appender.

Christian

2016-11-03 19:10 GMT+01:00 Brad Johnson <[hidden email]>:
I'm trying to find a good mechanism for intercepting logging events to fire them off to an AMQ queue for consumption elsewhere.  I don't really want to scrape log files for a number of reasons (obvious I think).\

I'm in karaf using AMQ and the Red Hat stack - with many of the items from Fuse but not all.

I had one fairly successful way of doing this which simply implemented the same interface as the Logger itself and when the Logger.getLogger(Class) was called I created a wrapper class that both logged to a file and sent the message via the queue.

But I noticed that there are a number of different mechanisms from camel log component to broker plugin (which I also implemented) and the OSGi LoggerReaderService and Listener and wondered if there's a good example of using that with Blueprint.  Most of the examples I've found are with ol' fashion service trackers and the like.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com




--
Matt Sicker <[hidden email]>