You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Brad Johnson <br...@mediadriver.com> on 2016/11/03 18:10:58 UTC

LogReaderService Blueprint?

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.

Re: LogReaderService Blueprint?

Posted by Brad Johnson <br...@mediadriver.com>.
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 <bo...@gmail.com> wrote:

> Most logging libraries delegate the actual logging to log4j, logback, or
> java.util.logging.
>
> On 3 November 2016 at 13:42, Brad Johnson <br...@mediadriver.com>
> 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 <
>> chris@die-schneider.net> wrote:
>>
>>> You should have a look at karaf decanter.
>>> https://karaf.apache.org/manual/decanter/latest-1/
>>>
>>> You can simply combine the log collector and the jms appender.
>>>
>>> Christian
>>>
>>> 2016-11-03 19:10 GMT+01:00 Brad Johnson <br...@mediadriver.com>:
>>>
>>>> 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
>>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>>>
>>
>>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>

Re: LogReaderService Blueprint?

Posted by Matt Sicker <bo...@gmail.com>.
Most logging libraries delegate the actual logging to log4j, logback, or
java.util.logging.

On 3 November 2016 at 13:42, Brad Johnson <br...@mediadriver.com>
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 <
> chris@die-schneider.net> wrote:
>
>> You should have a look at karaf decanter.
>> https://karaf.apache.org/manual/decanter/latest-1/
>>
>> You can simply combine the log collector and the jms appender.
>>
>> Christian
>>
>> 2016-11-03 19:10 GMT+01:00 Brad Johnson <br...@mediadriver.com>:
>>
>>> 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
>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>>
>> Open Source Architect
>> http://www.talend.com
>> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>>
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: LogReaderService Blueprint?

Posted by Brad Johnson <br...@mediadriver.com>.
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 <chris@die-schneider.net
> wrote:

> You should have a look at karaf decanter.
> https://karaf.apache.org/manual/decanter/latest-1/
>
> You can simply combine the log collector and the jms appender.
>
> Christian
>
> 2016-11-03 19:10 GMT+01:00 Brad Johnson <br...@mediadriver.com>:
>
>> 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
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
>
> Open Source Architect
> http://www.talend.com
> <https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>
>

Re: LogReaderService Blueprint?

Posted by Christian Schneider <ch...@die-schneider.net>.
You should have a look at karaf decanter.
https://karaf.apache.org/manual/decanter/latest-1/

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

Christian

2016-11-03 19:10 GMT+01:00 Brad Johnson <br...@mediadriver.com>:

> 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
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: LogReaderService Blueprint?

Posted by Matt Sicker <bo...@gmail.com>.
Can you just use the JMS appender from Log4j 2?

On 3 November 2016 at 13:10, Brad Johnson <br...@mediadriver.com>
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 <bo...@gmail.com>