4 Replies Latest reply on Nov 22, 2012 7:51 PM by ffang

    print logs within the camel routes into the console

    sergevil

      To print the logs into the console I add to etc/org.ops4j.pax.logging.cfg

      the settings like:

       

      log4j.logger.com.mycompany.a.b.c=INFO, stdout

       

      The question what should I define to see the logs within the camel route.

       

      When I add:

       

      log4j.logger.org.apache.camel.camel-core=INFO, stdout

       

      I am getting not only my logs but also the system's ones.

        • 1. Re: print logs within the camel routes into the console
          ffang

          Hi,

           

          Try with

          log4j.category.org.apache.camel=INFO, stdout

           

          Freeman

          • 2. Re: print logs within the camel routes into the console
            sergevil

            Thank you. It shows the logs like:

             

            FuseESB:karaf@root> OSGi environment detected.

            JMX enabled.

            Apache Camel 2.9.0.fuse-70-097 (CamelContext: 402-camel-3) is starting

            StatisticsLevel at All so enabling load performance statistics

            Found 1 @Converter classes to load

            Found 1 @Converter classes to load

            Found 0 @Converter classes to load

            Found 2 @Converter classes to load

            Found 2 @Converter classes to load

            Found 2 @Converter classes to load

            Found 1 @Converter classes to load

            Found 1 @Converter classes to load

            Endpoint is configured with noop=true so forcing endpoint to be idempotent as well

            Using default memory based idempotent repository with cache max size: 1000

            Route: process started and consuming from: Endpoint[file://resources?fileName=Enterprise_Fully_Featured_1.0.txt&noop=true]

            Route: createModel started and consuming from: Endpoint[activemq://createModel]

            Route: executeTests started and consuming from: Endpoint[activemq://executeTests]

            Total 3 routes, of which 3 is started.

            Apache Camel 2.9.0.fuse-70-097 (CamelContext: 402-camel-3) started in 0.369 seconds

             

            What I need is to print out the logs from the route itself. Like:

             

                       

            • 3. Re: print logs within the camel routes into the console
              sergevil

              I've found the solution.

               

              Need to add the next parameters:

               

               

              • 4. Re: print logs within the camel routes into the console
                ffang

                Hi,

                 

                Thanks for sharing this solution.

                 

                Freeman