camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1205098 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java components/camel-spring/src/test/resources/org/apache/camel/component/log/SpringLogMarkerTest-context.xml
Date Tue, 22 Nov 2011 17:36:49 GMT
Author: davsclaus
Date: Tue Nov 22 17:36:49 2011
New Revision: 1205098

URL: http://svn.apache.org/viewvc?rev=1205098&view=rev
Log:
CAMEL-4607: Added support for marker to log component. Thanks to Taariq for the patch.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/log/SpringLogMarkerTest-context.xml

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java?rev=1205098&r1=1205097&r2=1205098&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
Tue Nov 22 17:36:49 2011
@@ -37,10 +37,11 @@ public class LogComponent extends Defaul
 
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
         LoggingLevel level = getLoggingLevel(parameters);
+        String marker = getAndRemoveParameter(parameters, "marker", String.class);
         Integer groupSize = getAndRemoveParameter(parameters, "groupSize", Integer.class);
         Long groupInterval = getAndRemoveParameter(parameters, "groupInterval", Long.class);
 
-        CamelLogger camelLogger = new CamelLogger(remaining, level);
+        CamelLogger camelLogger = new CamelLogger(remaining, level, marker);
         Processor logger;
         if (groupSize != null) {
             logger = new ThroughputLogger(camelLogger, groupSize);

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/log/SpringLogMarkerTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/log/SpringLogMarkerTest-context.xml?rev=1205098&r1=1205097&r2=1205098&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/log/SpringLogMarkerTest-context.xml
(original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/log/SpringLogMarkerTest-context.xml
Tue Nov 22 17:36:49 2011
@@ -22,20 +22,10 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <bean id="log" class="org.apache.camel.component.log.LogEndpoint">
-        <property name="logger" ref="myLogger"/>
-    </bean>
-
-    <bean id="myLogger" class="org.apache.camel.processor.CamelLogProcessor">
-        <property name="level" value="WARN"/>
-        <property name="logName" value="cool"/>
-        <property name="marker" value="testMarker"/>
-    </bean>
-
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
-            <to ref="log"/>
+            <to uri="log:cool?level=WARN&amp;marker=testMarker"/>
             <log message="Another log message" logName="org.apache.camel" marker="myMarker"
loggingLevel="DEBUG"/>
             <to uri="mock:result"/>
         </route>



Mime
View raw message