Logging in Apache camel

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging in Apache camel

gokulj
Hello everyone,




So we have multiple camel routes that are configured by logback to log into separate log files. Is there a way to specify a logger into the route itself? The reason I ask is because, when switched to debug, everything other than what we explicitly log from our logger seems to go to the generic log. We'd like to instruct camel to log everything related to a route in to the particular log itself.




Thanks.





Reply | Threaded
Open this post in threaded view
|

Re: Logging in Apache camel

Claus Ibsen-2
Hi

You can take a look at MDC logging
http://camel.apache.org/mdc-logging

On Tue, Apr 10, 2018 at 8:42 AM,  <[hidden email]> wrote:

> Hello everyone,
>
>
>
>
> So we have multiple camel routes that are configured by logback to log into separate log files. Is there a way to specify a logger into the route itself? The reason I ask is because, when switched to debug, everything other than what we explicitly log from our logger seems to go to the generic log. We'd like to instruct camel to log everything related to a route in to the particular log itself.
>
>
>
>
> Thanks.
>
>
>
>
>



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Logging in Apache camel

gokulj
Hi Claus,




Thanks. Was able to get it to work. Besides just noticed something.




On an exchange with no out, initially exchange.hasOut() returns false.


But if I just call exchange.getOut() and exchange.hasOut() becomes true and causes issues. Is this expected?




Get Outlook for Android







On Tue, Apr 10, 2018 at 2:46 PM +0800, "Claus Ibsen" <[hidden email]> wrote:










Hi

You can take a look at MDC logging
http://camel.apache.org/mdc-logging

On Tue, Apr 10, 2018 at 8:42 AM,   wrote:

> Hello everyone,
>
>
>
>
> So we have multiple camel routes that are configured by logback to log into separate log files. Is there a way to specify a logger into the route itself? The reason I ask is because, when switched to debug, everything other than what we explicitly log from our logger seems to go to the generic log. We'd like to instruct camel to log everything related to a route in to the particular log itself.
>
>
>
>
> Thanks.
>
>
>
>
>



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





Reply | Threaded
Open this post in threaded view
|

Re: Logging in Apache camel

Claus Ibsen-2
On Fri, Apr 13, 2018 at 9:23 AM,  <[hidden email]> wrote:

> Hi Claus,
>
>
>
>
> Thanks. Was able to get it to work. Besides just noticed something.
>
>
>
>
> On an exchange with no out, initially exchange.hasOut() returns false.
>
>
> But if I just call exchange.getOut() and exchange.hasOut() becomes true and causes issues. Is this expected?
>

Yes read the javadoc of these methods, and see the FAQ:
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

>
>
>
> Get Outlook for Android
>
>
>
>
>
>
>
> On Tue, Apr 10, 2018 at 2:46 PM +0800, "Claus Ibsen" <[hidden email]> wrote:
>
>
>
>
>
>
>
>
>
>
> Hi
>
> You can take a look at MDC logging
> http://camel.apache.org/mdc-logging
>
> On Tue, Apr 10, 2018 at 8:42 AM,   wrote:
>> Hello everyone,
>>
>>
>>
>>
>> So we have multiple camel routes that are configured by logback to log into separate log files. Is there a way to specify a logger into the route itself? The reason I ask is because, when switched to debug, everything other than what we explicitly log from our logger seems to go to the generic log. We'd like to instruct camel to log everything related to a route in to the particular log itself.
>>
>>
>>
>>
>> Thanks.
>>
>>
>>
>>
>>
>
>
>
> --
> 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