I would consider as a big if I have the error on Windows. 

I’m suspecting an issue on Windows only (I hate this os ;) ). 

Let me setup a vm (just need time). 

Regard
JB

> Le 24 déc. 2020 à 16:36, michael e <[email protected]> a écrit :
> 
> 
> Ok thanks so is a bug ? Or i just have to change something ? (This is the 
> provided configuration i didn't change anythin expect fileName pattern)
> 
> Regards,
> Michael.
> 
> De : JB Onofré <[email protected]>
> Envoyé : jeudi 24 décembre 2020 16:23
> À : [email protected] <[email protected]>
> Objet : Re: Configuring MDC logging karaf 4 camel 3.7.0
>  
> Understood. I don’t have any error. The error you have seems related to the 
> rolling file configuration. 
> 
> Regards 
> JB
> 
>>> Le 24 déc. 2020 à 15:16, michael e <[email protected]> a écrit :
>>> 
>> 
>> Ok thanks  'All log files are created and populated' for me also just then 
>> in the karaf i see ERROR logs
>> 
>> Thanks,
>> Regards,
>> Michael.
>> 
>> De : JB Onofré <[email protected]>
>> Envoyé : jeudi 24 décembre 2020 15:05
>> À : [email protected] <[email protected]>
>> Objet : Re: Configuring MDC logging karaf 4 camel 3.7.0
>>  
>> Yeah. I tried with the karaf camel examples. All log files are created and 
>> populated. 
>> 
>> I will bootstrap a Windows vm to test. 
>> 
>> Regards 
>> JB
>> 
>>> Le 24 déc. 2020 à 14:52, michael e <[email protected]> a écrit :
>>> 
>>> 
>>> No it is a last fresh download version ok Karaf (4.3.0) did you try with 
>>> camel MDC properties ? And no permission issues.
>>> 
>>> Michael.
>>> 
>>> De : JB Onofré <[email protected]>
>>> Envoyé : jeudi 24 décembre 2020 14:42
>>> À : [email protected] <[email protected]>
>>> Objet : Re: Configuring MDC logging karaf 4 camel 3.7.0
>>>  
>>> By the way, you don’t have any permission issue ?
>>> 
>>>> Le 24 déc. 2020 à 14:42, JB Onofré <[email protected]> a écrit :
>>>> 
>>>> 
>>>> Do you use karaf vanilla or a custom distribution ?
>>>> 
>>>> I confirm that it works fine for me on Karaf vanilla (at least on Linux). 
>>>> 
>>>> Regards 
>>>> JB
>>>> 
>>>>> Le 24 déc. 2020 à 14:02, michael e <[email protected]> a écrit :
>>>>> 
>>>>> 
>>>>> I also add the absolute path i also get exception
>>>>> 
>>>>> my configuration:
>>>>> 
>>>>> # Sift - MDC routing
>>>>> log4j2.appender.routing.type = Routing
>>>>> log4j2.appender.routing.name = Routing
>>>>> log4j2.appender.routing.routes.type = Routes
>>>>> log4j2.appender.routing.routes.pattern = \$\$\\\{ctx:bundle.name\}
>>>>> log4j2.appender.routing.routes.bundle.type = Route
>>>>> log4j2.appender.routing.routes.bundle.appender.type = 
>>>>> RollingRandomAccessFile
>>>>> log4j2.appender.routing.routes.bundle.appender.name = 
>>>>> Bundle-\$\\\{ctx:bundle.name\}
>>>>> log4j2.appender.routing.routes.bundle.appender.fileName = 
>>>>> D:/karaf/apache-karaf-4.3.0/data/log/bundle-\$\\\{ctx:camel.contextId\}.log
>>>>> log4j2.appender.routing.routes.bundle.appender.filePattern = 
>>>>> ${karaf.log}/bundle-\$\\\{ctx:bundle.name\}.log.%i
>>>>> log4j2.appender.routing.routes.bundle.appender.append = true
>>>>> log4j2.appender.routing.routes.bundle.appender.layout.type = PatternLayout
>>>>> log4j2.appender.routing.routes.bundle.appender.layout.pattern = 
>>>>> ${log4j2.pattern}
>>>>> log4j2.appender.routing.routes.bundle.appender.policies.type = Policies
>>>>> log4j2.appender.routing.routes.bundle.appender.policies.size.type = 
>>>>> SizeBasedTriggeringPolicy
>>>>> log4j2.appender.routing.routes.bundle.appender.policies.size.size = 8MB
>>>>> 
>>>>> Exception:
>>>>> 
>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Cannot access 
>>>>> RandomAccessFile java.io.IOException: La syntaxe du nom de fichier, de 
>>>>> répertoire ou de volume est incorrecte
>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Could not 
>>>>> create plugin of type class 
>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender 
>>>>> for element RollingRandomAccessFile: java.lang.IllegalStateException: 
>>>>> ManagerFactory 
>>>>> [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory@7ab1ab29]
>>>>>  unable to create manager for 
>>>>> [D:/karaf/apache-karaf-4.3.0/data/log/bundle-${ctx:camel.contextId}.log] 
>>>>> with data 
>>>>> [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$FactoryData@3219c6e6]
>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Unable to 
>>>>> invoke factory method in class 
>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender 
>>>>> for element RollingRandomAccessFile: java.lang.IllegalStateException: No 
>>>>> factory method found for class 
>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender
>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Unable to 
>>>>> create Appender of type RollingRandomAccessFile
>>>>> 
>>>>> Regards,
>>>>> Michael.
>>>>> 
>>>>> De : Jean-Baptiste Onofre <[email protected]>
>>>>> Envoyé : jeudi 24 décembre 2020 07:13
>>>>> À : [email protected] <[email protected]>
>>>>> Objet : Re: Configuring MDC logging karaf 4 camel 3.7.0
>>>>>  
>>>>> Hi,
>>>>> 
>>>>> I just tested the configuration I provided in 
>>>>> etc/org.ops4j.pax.logging.cfg.
>>>>> 
>>>>> Here’s my config (in etc/org.ops4j.pax.logging.cfg):
>>>>> 
>>>>> First, I’ve enabled sift appender:
>>>>> 
>>>>> log4j2.rootLogger.appenderRef.Sift.ref = Routing
>>>>> 
>>>>> Then, I added the appender:
>>>>> 
>>>>> log4j2.appender.routing.type = Routing
>>>>> log4j2.appender.routing.name = Routing
>>>>> log4j2.appender.routing.routes.type = Routes
>>>>> log4j2.appender.routing.routes.pattern = \$\$\\\{ctx:bundle.name\}
>>>>> log4j2.appender.routing.routes.bundle.type = Route
>>>>> log4j2.appender.routing.routes.bundle.appender.type = 
>>>>> RollingRandomAccessFile
>>>>> log4j2.appender.routing.routes.bundle.appender.name = 
>>>>> Bundle-\$\\\{ctx:bundle.name\}
>>>>> log4j2.appender.routing.routes.bundle.appender.fileName = 
>>>>> ${karaf.log}/bundle-\$\\\{ctx:bundle.name\}.log
>>>>> log4j2.appender.routing.routes.bundle.appender.filePattern = 
>>>>> ${karaf.log}/bundle-\$\\\{ctx:bundle.name\}.log.%i
>>>>> log4j2.appender.routing.routes.bundle.appender.append = true
>>>>> log4j2.appender.routing.routes.bundle.appender.layout.type = PatternLayout
>>>>> log4j2.appender.routing.routes.bundle.appender.layout.pattern = 
>>>>> ${log4j2.pattern}
>>>>> log4j2.appender.routing.routes.bundle.appender.policies.type = Policies
>>>>> log4j2.appender.routing.routes.bundle.appender.policies.size.type = 
>>>>> SizeBasedTriggeringPolicy
>>>>> log4j2.appender.routing.routes.bundle.appender.policies.size.size = 8MB 
>>>>> 
>>>>> And it works fine.
>>>>> 
>>>>> It seems that your problem is about Windows.
>>>>> You are mixing windows style path with Unix style.
>>>>> 
>>>>> For fileName and filePattern, can you please use absolution path. 
>>>>> Something like:
>>>>> 
>>>>> log4j2.appender.routing.routes.bundle.appender.fileName = 
>>>>> D:\karaf\apache-karaf-4.3.0\bundle-\$\\\{ctx:bundle.name\}.log
>>>>> 
>>>>> It should work.
>>>>> 
>>>>> Regards
>>>>> JB
>>>>> 
>>>>>> Le 23 déc. 2020 à 10:58, michael e <[email protected]> a écrit :
>>>>>> 
>>>>>> Hello,
>>>>>> 
>>>>>> I'm getting in trouble trying to configure MDC logging with latest Karaf 
>>>>>> and Camel Version
>>>>>> 
>>>>>> Here my logging configuration
>>>>>> 
>>>>>> log4j2.appender.routing.type = Routing
>>>>>> log4j2.appender.routing.name = Routing
>>>>>> log4j2.appender.routing.routes.type = Routes
>>>>>> log4j2.appender.routing.routes.pattern = \$\$\\\{ctx:bundle.name\}
>>>>>> log4j2.appender.routing.routes.bundle.type = Route
>>>>>> log4j2.appender.routing.routes.bundle.appender.type = 
>>>>>> RollingRandomAccessFile
>>>>>> log4j2.appender.routing.routes.bundle.appender.name = 
>>>>>> Bundle-\$\\\{ctx:bundle.name\}
>>>>>> log4j2.appender.routing.routes.bundle.appender.fileName = 
>>>>>> ${karaf.data}/log/sift-camel-\$\\\{ctx:camel.contextId\}.log
>>>>>> log4j2.appender.routing.routes.bundle.appender.filePattern = 
>>>>>> ${karaf.log}/bundle-\$\\\{ctx:bundle.name\}.log.%i
>>>>>> log4j2.appender.routing.routes.bundle.appender.append = true
>>>>>> log4j2.appender.routing.routes.bundle.appender.layout.type = 
>>>>>> PatternLayout
>>>>>> log4j2.appender.routing.routes.bundle.appender.layout.pattern = 
>>>>>> ${log4j2.pattern}
>>>>>> log4j2.appender.routing.routes.bundle.appender.policies.type = Policies
>>>>>> log4j2.appender.routing.routes.bundle.appender.policies.size.type = 
>>>>>> SizeBasedTriggeringPolicy
>>>>>> log4j2.appender.routing.routes.bundle.appender.policies.size.size = 8MB
>>>>>> 
>>>>>> Logging file is correctly created but i get exception in my Karaf
>>>>>> 
>>>>>> 
>>>>>> karaf@root()> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : 
>>>>>> Cannot access RandomAccessFile java.io.IOException: La syntaxe du nom de 
>>>>>> fichier, de répertoire ou de volume est incorrecte
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Could not 
>>>>>> create plugin of type class 
>>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender 
>>>>>> for element RollingRandomAccessFile: java.lang.IllegalStateException: 
>>>>>> ManagerFactory 
>>>>>> [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory@26d9daed]
>>>>>>  unable to create manager for 
>>>>>> [D:\karaf\apache-karaf-4.3.0\data/log/sift-camel-${ctx:camel.contextId}.log]
>>>>>>  with data 
>>>>>> [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$FactoryData@34bd66be]
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Unable to 
>>>>>> invoke factory method in class 
>>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender 
>>>>>> for element RollingRandomAccessFile: java.lang.IllegalStateException: No 
>>>>>> factory method found for class 
>>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Unable to 
>>>>>> create Appender of type RollingRandomAccessFile
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Cannot access 
>>>>>> RandomAccessFile java.io.IOException: La syntaxe du nom de fichier, de 
>>>>>> répertoire ou de volume est incorrecte
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Could not 
>>>>>> create plugin of type class 
>>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender 
>>>>>> for element RollingRandomAccessFile: java.lang.IllegalStateException: 
>>>>>> ManagerFactory 
>>>>>> [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$RollingRandomAccessFileManagerFactory@26d9daed]
>>>>>>  unable to create manager for 
>>>>>> [D:\karaf\apache-karaf-4.3.0\data/log/sift-camel-${ctx:camel.contextId}.log]
>>>>>>  with data 
>>>>>> [org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager$FactoryData@19f28b4]
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Unable to 
>>>>>> invoke factory method in class 
>>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender 
>>>>>> for element RollingRandomAccessFile: java.lang.IllegalStateException: No 
>>>>>> factory method found for class 
>>>>>> org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender
>>>>>> org.ops4j.pax.logging.pax-logging-log4j2 [log4j2] ERROR : Unable to 
>>>>>> create Appender of type RollingRandomAccessFile
>>>>>> 
>>>>>> There is updated documentation about how to configure ?
>>>>>> 
>>>>>> Michael.
>>>>> 

Reply via email to