Files
spring-integration/src/reference/docbook/logging-adapter.xml
Gary Russell d54a88f528 INT-2939 LoggingHandler Improvements
- Don't evaluate expression if the log level is not enabled
- Add mutually exclusive assertions (already protected by the parser
  but not for programmatic configuration).

INT-2944 Document <logging-channel-adapter/>

Add reference sub-chapter.

INT-2939 Polishing - PR Comments

- remove unnecessary cast.
- add setter for level changes.

Polishing

* Change setter to use enum.
* Add getter for current level.
* Rename method to 'createLogMessage'.
2013-04-03 00:11:17 -04:00

71 lines
3.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section version="5.0" xml:id="logging-channel-adapter" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ns5="http://www.w3.org/1999/xhtml"
xmlns:ns4="http://www.w3.org/1998/Math/MathML"
xmlns:ns3="http://www.w3.org/2000/svg"
xmlns:ns="http://docbook.org/ns/docbook">
<title>Logging Channel Adapter</title>
<para>
The <code>&lt;logging-channel-adapter/&gt;</code> is often used in conjunction with a
Wire Tap, as discussed in
<xref linkend="channel-wiretap"/>. However, it can also be used as the ultimate consumer
of any flow. For example, consider a flow that ends with a <code>&lt;service-activator/&gt;</code>
that returns a result, but you wish to discard that result. To do that, you could send the
result to <classname>NullChannel</classname>. Alternatively, you can route it to an <code>INFO</code>
level <code>&lt;logging-channel-adapter/&gt;</code>; that way, you can see
the discarded message when logging at <code>INFO</code> level, but not see it when logging at,
say, <code>WARN</code> level. With a <classname>NullChannel</classname>, you would only see the
discarded message when logging at <code>DEBUG</code> level.
</para>
<programlisting><![CDATA[
<int:logging-channel-adapter
channel=""]]><co id="log-ca-010" /><![CDATA[
level="INFO"]]><co id="log-ca-020" /><![CDATA[
expression=""]]><co id="log-ca-030" /><![CDATA[
log-full-message="false"]]><co id="log-ca-040" /><![CDATA[
logger-name=""]]><co id="log-ca-050" /><![CDATA[/>
]]></programlisting>
<calloutlist>
<callout arearefs="log-ca-010">
<para>
The channel connecting the logging adapter to an upstream component.
</para>
</callout>
<callout arearefs="log-ca-020">
<para>
The logging level at which messages sent to this adapter will be logged.
Default: <code>INFO</code>.
</para>
</callout>
<callout arearefs="log-ca-030">
<para>
A SpEL expression representing exactly what part(s) of the message will be
logged. Default: <code>payload</code> - just the payload will be logged.
This attribute cannot be specified if <code>log-full-message</code> is
specified.
</para>
</callout>
<callout arearefs="log-ca-040">
<para>
When <code>true</code>, the entire message will be logged (including headers).
Default: <code>false</code> - just the payload will be logged.
This attribute cannot be specified if <code>expression</code> is
specified.
</para>
</callout>
<callout arearefs="log-ca-050">
<para>
Specifies the <emphasis>name</emphasis> of the logger (known as
<code>category</code> in <code>log4j</code>)
used for log messages created by this adapter. This enables setting the
log name (in the logging subsystem) for individual adapters. By default, all
adapters will log under the name
<code>org.springframework.integration.handler.LoggingHandler</code>.
</para>
</callout>
</calloutlist>
</section>