camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: log exception message, not stack trace
Date Wed, 04 Oct 2017 18:55:07 GMT
On Wed, Oct 4, 2017 at 8:49 PM, Mark <elihusmails@gmail.com> wrote:
> Sorry for the confusion.  Its the log file that is used by log4j.
>

Okay so you need to transform the error message you want to write to
that log, you can do this by setting a dead letter channel error
handler, and then route to a direct endpoint where you can then do a
message transformation where you can build the error message, and then
route it to the log endpoint

dead letter channel (direct:myerror)

from direct:myerror
   transform simple("Darn something went wrong because ${exception.message}")
   to log:myerror?level=ERROR





>
> On Wed, Oct 4, 2017 at 2:44 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>
>> It depends a bit what you mean by our log file? Is it the log file you
>> may use with log4j or logback. Or do you want Camel to write to a
>> special log file via its file component.
>>
>>
>> On Wed, Oct 4, 2017 at 8:23 PM, Mark <elihusmails@gmail.com> wrote:
>> > Do you know what this option is and will all logging be turned off or
>> just
>> > the stack trace ?
>> >
>> >
>> > On Wed, Oct 4, 2017 at 2:09 PM, Claus Ibsen <claus.ibsen@gmail.com>
>> wrote:
>> >
>> >> There is an option to turn off logging the stacktrace on the error
>> >> handler / onException etc
>> >>
>> >> On Wed, Oct 4, 2017 at 8:03 PM, Mark <elihusmails@gmail.com> wrote:
>> >> > I've been looking through the source code and documentation for this.
>> >> I'd
>> >> > like to log the exception message to our log file and not the entire
>> >> stack
>> >> > trace.  Is this something that can be done with the current baseline
>> or
>> >> do
>> >> > I need to write a custom ErrorHandler?
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> http://davsclaus.com @davsclaus
>> >> Camel in Action 2: https://www.manning.com/ibsen2
>> >>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message