0

Unfortunately, there is no 'critical' or 'fatal' logging level in both Apache Camel log component and log EIP.

We use NXlog for transmitting Camel (in particularly) logs to Graylog and it is necessary to set 'critical' level there.

Is there some workaround to achieve it?

UPD

I've tried to implement logging marker as https://www.slf4j.org/faq.html#fatal suggests.

Here is my Spring XML:

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    <route id="process.message">
        <from uri="file:/test?delete=true"/>
        <log message="fatal marker test" loggingLevel="ERROR" marker="fatalmarker"/>
        <to uri="file:/my"/>
    </route>
</camelContext>

<bean id="fatalmarker" class="org.slf4j.MarkerFactory" factory-method="getMarker">
    <constructor-arg type="java.lang.String" value="CRITICAL"/>
</bean>

Camel has started but there is no marker in log:

2018-04-17 17:14:24,361 | ERROR | fatal marker test | get.message | Camel (camel) thread #0 - file:///test

Am I not sure if I use it in a proper way? How can I get markers in the logs?

UPD UPD

Did not notice until now:

In combination with logging frameworks such as log4j and java.util.logging which do not support markers, marker data will be silently ignored

We are using ActiveMQ which as I can see uses exactly the log4j, so could anything be done in this case?

Greenev
  • 871
  • 6
  • 23

1 Answers1

1

The logging API in Apache Camel uses slf4j. So we only support / can do what this API supports.

The slf4j project has a FAQ about the absent of FATAL logging level https://www.slf4j.org/faq.html#fatal

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Thanks for your answer! I've updated the question, could you take a look on it and say if it is possible to make something up when using log4j? – Greenev Apr 17 '18 at 15:39