Discussion:
Logging in Apache camel
g***@icloud.com
2018-04-10 06:42:04 UTC
Permalink
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
2018-04-10 06:46:14 UTC
Permalink
Hi

You can take a look at MDC logging
http://camel.apache.org/mdc-logging
Post by g***@icloud.com
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
g***@icloud.com
2018-04-13 07:23:52 UTC
Permalink
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" <***@gmail.com> wrote:










Hi

You can take a look at MDC logging
http://camel.apache.org/mdc-logging
Post by g***@icloud.com
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
2018-04-13 07:29:09 UTC
Permalink
Post by g***@icloud.com
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
Post by g***@icloud.com
Get Outlook for Android
Hi
You can take a look at MDC logging
http://camel.apache.org/mdc-logging
Post by g***@icloud.com
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
-----------------
Camel in Action 2: https://www.manning.com/ibsen2
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Loading...