We've written one in ServiceMix and have found no problem with it.
The appender is exported in the OSGi registry using spring and the
following beans:
<bean id="vmLogAppender"
class="org.apache.servicemix.gshell.log.VmLogAppender">
<property name="events" ref="events" />
</bean>
<bean id="events" class="org.apache.servicemix.gshell.log.LruList">
<constructor-arg value="${size}" />
</bean>
<osgi:service ref="vmLogAppender"
interface="org.ops4j.pax.logging.spi.PaxAppender">
<osgi:service-properties>
<entry>
<key><util:constant
static-field="org.ops4j.pax.logging.PaxLoggingService.APPENDER_NAME_PROPERTY"/></key>
<value>VmLogAppender</value>
</entry>
</osgi:service-properties>
</osgi:service>
Then, the pax logging configuration looks like:
log4j.rootLogger=INFO, out, osgi:VmLogAppender
So in short, the appender must be registered in the OSGi registry
using the org.ops4j.pax.logging.spi.PaxAppender interface and have a
service property named org.ops4j.pax.logging.appender.name. The value
of this property can be referenced using osgi:[value].
On Fri, Sep 26, 2008 at 11:04 AM, David Leangen <[EMAIL PROTECTED]> wrote:
>
> Man, I must be lysdexic... I wrote "customer" twice instead of "custom".
> Or maybe my hands just have minds of their own...
>
> Anyhooooo...
>
>
>> > What is the way to add a customer appender when using pax-logging?
>>
>> The mechanism exist, but is not fully tested. It is a matter of
>> creating them in your own bundles and register them to the Service
>> Registry.
>
> Should I assume that you are referring to implementing PaxAppender and
> registering as a service?
>
> That's the only thing I found in the code...
>
> I don't see how my Appender is supposed to hook into that, so maybe
> that's not the right interface...
>
>
>
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://open.iona.com
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general