camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grzegorz Grzybek (JIRA)" <>
Subject [jira] [Commented] (CAMEL-6694) Make Log component and EIP compatible with log4j MDC Sift Appender
Date Tue, 01 Apr 2014 09:07:27 GMT


Grzegorz Grzybek commented on CAMEL-6694:

I did simple trick with user provided logger instance when creating route. Here's sample pax-exam
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();
        registry.bind("mylogger", LoggerFactory.getLogger("org.apache.camel.SIFT"));
        return registry;
    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();
        return camelContext;
    public void testSendMessageToInfoLogWithSiftLogging() throws Exception {
        template.sendBody("log:org.apache.camel.SIFT?level=info&logger=#mylogger", "<level>INFO</level>");
        template.sendBody("log:org.apache.camel.SIFT?level=debug&logger=#mylogger", "<level>DEBUG</level>");
        template.sendBody("log:org.apache.camel.SIFT?level=info&logger=#mylogger", "<level>INFO</level>");
        template.sendBody("log:org.apache.camel.SIFT?level=error&logger=#mylogger", "<level>ERROR</level>");

and the log is correctly produced in {{KARAF_BASE/data/log/PAXEXAM-PROBE-143533e1-9f41-4734-ba6c-ab1f1e417fd8.log}}.

The only thing that I don't like is that the *org.apache.camel.SIFT* part in endpoint URI
isn't actually used. Do you have an idea how to make it cleaner?

> Make Log component and EIP compatible with log4j MDC Sift Appender
> ------------------------------------------------------------------
>                 Key: CAMEL-6694
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.12.0
>            Reporter: Raúl Kripalani
>            Assignee: Grzegorz Grzybek
>             Fix For: 2.13.1
> Refer to
for more info.
> We should use the Camel Context's Classloader to initialize the Logger instance.

This message was sent by Atlassian JIRA

View raw message