Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 20958 invoked from network); 16 Sep 2008 10:32:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 10:32:15 -0000 Received: (qmail 13755 invoked by uid 500); 16 Sep 2008 10:32:11 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 13613 invoked by uid 500); 16 Sep 2008 10:32:10 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 13602 invoked by uid 99); 16 Sep 2008 10:32:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 03:32:10 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 209.85.217.15 as permitted sender) Received: from [209.85.217.15] (HELO mail-gx0-f15.google.com) (209.85.217.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 10:31:10 +0000 Received: by gxk8 with SMTP id 8so24930747gxk.14 for ; Tue, 16 Sep 2008 03:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=EvaDUwQt0vl829Vf3jTe5h0TcjGZ96f+fP6FfUFkqgc=; b=creHSf7Ds+ELuTqOEiyKVFg0bXiBBT0GzMis/qVR57A9VQXidtwPqjRK8OqwN/b/9F ZkTOcOJk1ZlRCROSqm8rftnsCEy/synacHJ7Wfw6IlDNnStrJxZI5A7j0yk/6m9HDr8b INcF9XHQTD5p3M3rS+cprUUXMSM514MMm6Jkg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=P5qDEbWU4SDKm9bAbMGPpjMG24NfdXGWx8CvISNx0UUD5OBPBGfiy5VZpZHr0dt3O/ LcrOJ1nIriZHoU8iA7ccrdJ3eZ1o0iZaSBLy6zLcRN4eDqItILyzae3mz3B0Mil+F+oR jTXfTVBvZbm6szWQ3gey+q4M0bUC0KepVvGZA= Received: by 10.90.54.11 with SMTP id c11mr616721aga.28.1221561101855; Tue, 16 Sep 2008 03:31:41 -0700 (PDT) Received: by 10.90.117.12 with HTTP; Tue, 16 Sep 2008 03:31:41 -0700 (PDT) Message-ID: Date: Tue, 16 Sep 2008 11:31:41 +0100 From: "James Strachan" To: camel-user@activemq.apache.org Subject: Re: Custom log messages In-Reply-To: <19508601.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <19508418.post@talk.nabble.com> <4C1FB9C00D24A140906239533638C4D20551C48C@EXVS04.exserver.dk> <19508601.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org 2008/9/16 raulvk.soa : > > Hi Claus, > > My requirement is a bit different... I need to print human-readable messages > such as "Validating against XML Schema...", "Validation OK", "Validation > ERROR", etc... Therefore, I need to be able to specify the message that > should be printed out when I am building the route. > > Don't know if I have expressed myself clearly... > > Is there any functionality in Camel that will allow me to do send custom log > messages to the Log component? You could use a templating engine to transform the message into a human readable format first, before routing it to the log component. See... http://activemq.apache.org/camel/templating.html for example from("..."). to("velocity:scripts/Validating.vm"). to("log:Validating"); then your Validating.vm script could generate text extracting some headers or payload from the message etc. Maybe if the logging information is simpler; we could just use normal expressions? e.g. using the EL as a kinda templating engine from("..."). setBody().el("Validating ${in.header.foo} blah"). to("log:Validating"); Templating engines come into their own when you are composing a large page of text such as an email with embedded values; if its a single line of text for a log message or SMS or something then using EL or XPath or something might be simpler as you can inline the expression inside your route. -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com