title: How to configure apache camel to see the reason of the shutdown?
body: <p>Preconditions: </p>
  
  <p>Camel 2.17</p>
  
  <p>I had defined some routes, that routes contain entries like:</p>
  
  <pre><code>.to ("log:org.apache.camel?level=DEBUG")
  </code></pre>
  
  <p>My logback config contains:</p>
  
  <pre><code>&lt;logger name="org.apache.camel" level="TRACE" /&gt;
  </code></pre>
  
  <p>Context definition begins with:</p>
  
  <pre><code>&lt;camel:camelContext id="someContext" ... trace="true"&gt;
  </code></pre>
  
  <p>When I am starting Camel, then I see Camel is proceeding and finally without <strong>ANY</strong> error report just shutting down. This looks like:</p>
  
  <pre><code>2016-10-04 13:40:56,146 [localhost-startStop-1] TRACE org.apache.camel.model.ProcessorDefinitionHelper - There are 6 properties on: From[direct:process]
  2016-10-04 13:40:58,042 [localhost-startStop-1] DEBUG org.apache.camel.spring.SpringCamelContext - onApplicationEvent: org.springframework.context.event.ContextClosedEvent[source=Root WebApplicationContext: startup date [Tue Oct 04 13:37:25 CEST 2016]; root of context hierarchy]
  2016-10-04 13:40:58,066 [localhost-startStop-1] INFO  org.apache.camel.spring.SpringCamelContext - Apache Camel 2.17.3 (CamelContext: someContext) is shutting down
  </code></pre>
  
  <p>I have as well:</p>
  
  <pre><code>    onException( java.lang.Exception.class )
              .handled( false )
              .to( "log:GeneralError?level=ERROR" );
  </code></pre>
  
  <p>But this is more related to the exchange processing and not to startup.</p>
  
  <p>Is there any generic way to check what is going on out there?
  For example: </p>
  
  <ul>
  <li>Is there any class missing and class loader fails?</li>
  <li>Or is any exception thrown?</li>
  <li>Or some connection fails?</li>
  </ul>
  
  <p>Complete route definition:</p>
  
  <pre><code>final RouteDefinition kafkaRouteDefinition = from( "kafka:{{kafka.broker.endpoints}}" +
          "?topic={{kafka.topic.name}}" +
          "&amp;groupId=my_group" +
          "&amp;autoOffsetReset=earliest" +
          "&amp;consumersCount={{kafka.consumer.count}}" );
  
  LOG.info( "Kafka route definition: " + kafkaRouteDefinition.toString() );
  
  kafkaRouteDefinition
          .routeId( Constants.ROUTE_ID_PROCESS_KAFKA_MESSAGES )
          .to( "log:org.apache.camel?level=DEBUG" )
          .process( new RawMessageProcessor() ).id( RawMessageProcessor.class.getSimpleName() )
          .to( "log:org.apache.camel?level=DEBUG" )
          .unmarshal( inputMessageFormat ).id( "ConvertRawMessageToLogline" )
          .to( "log:org.apache.camel?level=DEBUG" )
          .process( new LoglineMessageProcessor() ).id( LoglineMessageProcessor.class.getSimpleName() )
          .to( "log:org.apache.camel?level=DEBUG" )
          .to( Constants.CAMEL_PROCESS_ENDPOINT )
          .to( "log:org.apache.camel?level=DEBUG" )
          .multicast().stopOnException()
          .to( "log:org.apache.camel?level=DEBUG" )
          .to( Constants.CAMEL_STORE_ENDPOINT
                  , Constants.CAMEL_INDEX_ENDPOINT
          )
          .to( "log:org.apache.camel?level=DEBUG" )
          .end();
  </code></pre>