general  

[issues] Commented: (PAXLOGGING-72) No implementations available for PaxAppender

Mateusz Nowakowski (JIRA)
Tue, 02 Feb 2010 05:38:40 -0800

    [ 
http://issues.ops4j.org/browse/PAXLOGGING-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13306#action_13306
 ] 

Mateusz Nowakowski commented on PAXLOGGING-72:
----------------------------------------------

The problem is "it is not possible to use own appender based on log4j using 
existing PaxLoggingConfigurator."

For example I have own log4j appender implementation which extends some log4j 
appender implementation.
I have it already. It works perfectly in non-OSGI environment.

I'm unable to use it via PaxLoggingConfigurator, because PaxLoggingConfigurator 
won't see it.  
PaxLoggingConfigurator sees only log4j appenders in its log4j embbeded jar.
The only way to use own appender is to provide PaxAppender as a OSGI service. 


Because there is no PaxAppender implementation, i'm forced to create 
PaxAppender wrapper which transforms PaxLoggingEvent into log4j LoggingEvent 
and pass it to my own log4j appender. But I'm unable to provide own log4j 
appender, because PAX Logging doesn;t export all log4j code.

To do so  
"it requires an additional log4j bundle in the application" - because log4j in 
already embedded in the PAX Logging Service. 
PaxLogging API exports some log4j packages as well. So we have at least three 
log4j in the system. Two for PAX and one for my new appender.

"all log4j packages should be exported" - because at the moment log4j logger 
can be used for logging, but it is impossible to provide own appenders.

So in my opinion :
PAX Logging API should contain and export all log4j packages. 
PAX Logging Service should *not* embed log4j jar, but should import necessary 
log4j packages.(from PAX Logging API bundle)
PAX Logging Service and its PaxLoggingConfigurator should be able  to use not 
only PaxAppenders provided by OSGI service, but log4j Appenders as well. 
Creating AppenderBridgeImpl is not necessary.

I know that the subject is not straightforward. 
The issue with PAX Logging is that its configuration is based on log4j, but it 
is impossible to use all log4j capabilities.

> No implementations available for PaxAppender
> --------------------------------------------
>
>                 Key: PAXLOGGING-72
>                 URL: http://issues.ops4j.org/browse/PAXLOGGING-72
>             Project: Pax Logging
>          Issue Type: Improvement
>          Components: Service
>    Affects Versions: 1.4
>         Environment: WinXp, Fuse 4.2 RC1
>            Reporter: Mateusz Nowakowski
>            Assignee: Niclas Hedhman
>
> Currently it is not possible to use own appender based on log4j using 
> existing PaxLoggingConfigurator.  It is really strange because 
> PaxLoggingConfigurator is based on log4j appenders.
> There can be used only PaxAppender implementation, but none is available.
> There are two solutions to solve the problem. Both are bad.
> - create own appender based on log4j appender and attach it via Fragment-Host 
> mechanism to Pax Logging Service bundle -- bad solution, because current 
> PaxLoggingConfigurator do not support error handlers etc (I've already 
> created PAXLOGGING-71 for it)
> - write PaxAppender implementation which aggregates any log4 appender - bad, 
> because it requires an additional log4j bundle in the application  (Pax 
> Logging exports only two log4j packages without most of log4j code, 
> especially without appenders), what is more it is a performance killer, 
> because PaxAppender implementation wraps some appender based on log4 
> appender, and PAX creates own wrapper to return log4j appender from 
> PaxAppender...
> There are two complementary solution:
> -  PAXLOGGING-71
> - PaxLoggingConfigurator or its AppenderTracker should track not only 
> PaxAppender but original log4j Appender. What is more all log4j packages 
> should be exported.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general