blob: c24f5b96545c95923590015ee8f2fcdaf1dc2735 [file] [log] [blame]
[[Pax-Logging-PaxLoggingcomponent]]
PaxLogging component
~~~~~~~~~~~~~~~~~~~~
*Available in Camel 2.6*
The `paxlogging` component can be used in an OSGi environment to receive
http://wiki.ops4j.org/display/paxlogging/Pax+Logging[PaxLogging] events
and process them.
[[Pax-Logging-Dependencies]]
Dependencies
^^^^^^^^^^^^
Maven users need to add the following dependency to their `pom.xml`
[source,xml]
-------------------------------------------
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-paxlogging</artifactId>
<version>${camel-version}</version>
</dependency>
-------------------------------------------
where `${camel-version`} must be replaced by the actual version of Camel
(2.6.0 or higher).
[[Pax-Logging-URIformat]]
URI format
^^^^^^^^^^
[source,xml]
-----------------------------
paxlogging:appender[?options]
-----------------------------
where `appender` is the name of the pax appender that need to be
configured in the PaxLogging service configuration.
[[Pax-Logging-URIoptions]]
URI options
^^^^^^^^^^^
// component options: START
The OSGi PAX Logging component supports 1 options which are listed below.
{% raw %}
[width="100%",cols="2,1m,7",options="header"]
|=======================================================================
| Name | Java Type | Description
| bundleContext | BundleContext | The OSGi BundleContext is automatic injected by Camel
|=======================================================================
{% endraw %}
// component options: END
// endpoint options: START
The OSGi PAX Logging component supports 5 endpoint options which are listed below:
{% raw %}
[width="100%",cols="2,1,1m,1m,5",options="header"]
|=======================================================================
| Name | Group | Default | Java Type | Description
| appender | consumer | | String | *Required* Appender is the name of the pax appender that need to be configured in the PaxLogging service configuration.
| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
| exceptionHandler | consumer (advanced) | | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
| exchangePattern | consumer (advanced) | | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
|=======================================================================
{% endraw %}
// endpoint options: END
[[Pax-Logging-Messagebody]]
Message body
^^^^^^^^^^^^
The `in` message body will be set to the received PaxLoggingEvent.
[[Pax-Logging-Exampleusage]]
Example usage
^^^^^^^^^^^^^
[source,xml]
----------------------------------
<route>
<from uri="paxlogging:camel"/>
<to uri="stream:out"/>
</route>
----------------------------------
Configuration:
[source,java]
----------------------------------------------------------
log4j.rootLogger=INFO, out, osgi:VmLogAppender, osgi:camel
----------------------------------------------------------