You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by an...@apache.org on 2011/05/26 22:43:21 UTC

svn commit: r1128071 - /karaf/trunk/manual/src/main/webapp/users-guide/logging-system.conf

Author: anierbeck
Date: Thu May 26 20:43:20 2011
New Revision: 1128071

URL: http://svn.apache.org/viewvc?rev=1128071&view=rev
Log:
[KARAF-543] - Add manual section around log custom appenders
applied patch provided by cschneide

Modified:
    karaf/trunk/manual/src/main/webapp/users-guide/logging-system.conf

Modified: karaf/trunk/manual/src/main/webapp/users-guide/logging-system.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/users-guide/logging-system.conf?rev=1128071&r1=1128070&r2=1128071&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/users-guide/logging-system.conf (original)
+++ karaf/trunk/manual/src/main/webapp/users-guide/logging-system.conf Thu May 26 20:43:20 2011
@@ -1,7 +1,7 @@
 
 h1. Logging system
 
-Karaf provides a powerful logging system based on [OPS4j Pax Logging|http://wiki.ops4j.org/confluence/display/ops4j/Pax+Logging]. 
+Karaf provides a powerful logging system based on [OPS4j Pax Logging|http://wiki.ops4j.org/display/paxlogging/Pax+Logging]. 
 
 In addition to being a standard OSGi Log service, it supports the following APIs:
 * Apache Commons Logging
@@ -154,4 +154,19 @@ java.lang.IllegalArgumentException: Comm
 
 h3. Using your own appenders
 
-If you plan to use your own appenders, you need to create an OSGi bundle and attach it as a fragment to the bundle with a symbolic name of {{org.ops4j.pax.logging.pax-logging-service}}.  This way, the underlying logging system will be able to see and use your appenders.
+If you plan to use your own appenders, you need to create an OSGi bundle and attach it as a fragment to the bundle with a symbolic name of 
+{{org.ops4j.pax.logging.pax-logging-service}}.  This way, the underlying logging system will be able to see and use your appenders.
+
+So for example you write a log4j appender:
+class MyAppender extends AppenderSkeleton {
+...
+}
+
+Then you need to package the appender in a jar with a Manifest like this:
+
+Manifest:
+Bundle-SymbolicName: org.mydomain.myappender       
+Fragment-Host: org.ops4j.pax.logging.pax-logging-service
+...
+
+Now you can use the appender in your log4j config file like shown in the config examples above.