Re: KARAF 4.1.5 & pax-logging-service
I'm more familiar with log4j myself. However, OSGi issues with Spring seem to be a common issue thanks to Spring snubbing OSGi for a while. Chances are that this has improved a bit in Spring 5 thanks to Java 9 modules forcing them to embrace modularity again, though that doesn't help in this scenario, sorry. On 13 March 2018 at 23:23, munishgupta.asr wrote: > Hi Matt, > > Thanks for guiding on Same like pax-logging-service issue. we are in good > shape for that. > > same like that, earlier org.springframework libraries were also downloaded > and started when we were running the package. we were defining these as > bootfeatures during prepare package. > org.apache.karaf.tooling > karaf-maven-plugin > ${apache-karaf.maven.plugin.version} > true > > false > > framework > standard > eventadmin > jasypt-encryption > config > jpa/1.0.4 > openjpa > transaction > spring > spring-dm > spring-dm-web > scr > http > war > > > but after upgrading to 4.2.0, These spring libraries are not getting > downloaded and started. When i start my project, it fails with the OSGI > wiring issues for spring dependency like org.springframework.web.servlet > > then I am trying to add it as OSGI bundle in features.xml by adding like > bundle > start-level="85">wrap:mvn:org.springframework/spring-webmvc/ > 4.3.7.RELEASE > > but it still fails. Can you give any pointers here? > > > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html > -- Matt Sicker
Re: KARAF 4.1.5 & pax-logging-service
Hi Matt, Thanks for guiding on Same like pax-logging-service issue. we are in good shape for that. same like that, earlier org.springframework libraries were also downloaded and started when we were running the package. we were defining these as bootfeatures during prepare package. org.apache.karaf.tooling karaf-maven-plugin ${apache-karaf.maven.plugin.version} true false framework standard eventadmin jasypt-encryption config jpa/1.0.4 openjpa transaction spring spring-dm spring-dm-web scr http war but after upgrading to 4.2.0, These spring libraries are not getting downloaded and started. When i start my project, it fails with the OSGI wiring issues for spring dependency like org.springframework.web.servlet then I am trying to add it as OSGI bundle in features.xml by adding like bundle start-level="85">wrap:mvn:org.springframework/spring-webmvc/4.3.7.RELEASE but it still fails. Can you give any pointers here? -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
Re: KARAF 4.1.5 & pax-logging-service
The plugin docs for log4j2 itself [1] covers more about it. If you’re trying to extend an existing appender, you’ll have to extend its corresponding manager class instead (an appender in v2 is more of a configuration mechanism while the manager handles the underlying data sink). I’d also suggest discussing with the Apache list if you’d like to integrate or request your feature upstream. [1]: http://logging.apache.org/log4j/2.x/manual/plugins.html On Tue, Mar 6, 2018 at 21:18, munishgupta.asr wrote: > Hello JB, > > As you suggested and mentioned like that "If so, you should update your > appender to log4j2 style and attach to pax-logging-log4j2". > > I was trying to do that but it seems creating custom appenders is very > different here. earlier I was extending fileappenders and providing > configuration parameters in constructor through CFG file. but now it looks > very different. > > is there sample examples to refer about how to create custom file appenders > and attach it with pax-logging-log4j2 as fragment? > > or is there any way to still use pax-logging-service with KARAF 4.1.x > onwards as we are OK with log4j1 implementation. > > can you please help? kindly answer. > > Regards > Munish > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html > -- Matt Sicker
Re: KARAF 4.1.5 & pax-logging-service
Hello JB, As you suggested and mentioned like that "If so, you should update your appender to log4j2 style and attach to pax-logging-log4j2". I was trying to do that but it seems creating custom appenders is very different here. earlier I was extending fileappenders and providing configuration parameters in constructor through CFG file. but now it looks very different. is there sample examples to refer about how to create custom file appenders and attach it with pax-logging-log4j2 as fragment? or is there any way to still use pax-logging-service with KARAF 4.1.x onwards as we are OK with log4j1 implementation. can you please help? kindly answer. Regards Munish -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
Re: KARAF 4.1.5 & pax-logging-service
Hi, Yes it looks creating a custom appender is very different with log4j2 and not like that with log4j1 where we were using pax-logging-service as fragment-host with our custom bundle. we don't have AppenderSkeleton class also here. how shall i approach it now? do we have any adapter kind of thing here to continue using same code or we will have to rewrite our logging module. Regards Munish -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
Re: KARAF 4.1.5 & pax-logging-service
Hi, Yes it looks creating a custom appender is very different with log4j2 and not like that with log4j1 where we were using pax-logging-service as fragment-host with our custom bundle. we don't have AppenderSkeleton class also here. how shall i approach it now? do we have any adapter kind of thing here to continue using same code or we will have to rewrite our logging module. Regards Munish Matt Sicker wrote > If you have a custom log4j 1 appender, there's limited support in > log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not > sure > how that would interact without some fragment hackery. > > On 2 March 2018 at 03:34, Jean-Baptiste Onofré < > jb@ > > wrote: > >> Thanks, please let me know if you have any issue. >> >> Regards >> JB >> >> On 03/02/2018 10:33 AM, munishgupta.asr wrote: >> > Thanks JB. >> > >> > I will try and get back with results. >> > >> > Regards >> > Munish >> > >> > >> > >> > -- >> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html >> > >> >> -- >> Jean-Baptiste Onofré >> > jbonofre@ >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > > > > -- > Matt Sicker < > boards@ > > Matt Sicker wrote > If you have a custom log4j 1 appender, there's limited support in > log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not > sure > how that would interact without some fragment hackery. > > On 2 March 2018 at 03:34, Jean-Baptiste Onofré < > jb@ > > wrote: > >> Thanks, please let me know if you have any issue. >> >> Regards >> JB >> >> On 03/02/2018 10:33 AM, munishgupta.asr wrote: >> > Thanks JB. >> > >> > I will try and get back with results. >> > >> > Regards >> > Munish >> > >> > >> > >> > -- >> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html >> > >> >> -- >> Jean-Baptiste Onofré >> > jbonofre@ >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > > > > -- > Matt Sicker < > boards@ > > Matt Sicker wrote > If you have a custom log4j 1 appender, there's limited support in > log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not > sure > how that would interact without some fragment hackery. > > On 2 March 2018 at 03:34, Jean-Baptiste Onofré < > jb@ > > wrote: > >> Thanks, please let me know if you have any issue. >> >> Regards >> JB >> >> On 03/02/2018 10:33 AM, munishgupta.asr wrote: >> > Thanks JB. >> > >> > I will try and get back with results. >> > >> > Regards >> > Munish >> > >> > >> > >> > -- >> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html >> > >> >> -- >> Jean-Baptiste Onofré >> > jbonofre@ >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > > > > -- > Matt Sicker < > boards@ > > Matt Sicker wrote > If you have a custom log4j 1 appender, there's limited support in > log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not > sure > how that would interact without some fragment hackery. > > On 2 March 2018 at 03:34, Jean-Baptiste Onofré < > jb@ > > wrote: > >> Thanks, please let me know if you have any issue. >> >> Regards >> JB >> >> On 03/02/2018 10:33 AM, munishgupta.asr wrote: >> > Thanks JB. >> > >> > I will try and get back with results. >> > >> > Regards >> > Munish >> > >> > >> > >> > -- >> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html >> > >> >> -- >> Jean-Baptiste Onofré >> > jbonofre@ >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > > > > -- > Matt Sicker < > boards@ > > Matt Sicker wrote > If you have a custom log4j 1 appender, there's limited support in > log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not > sure > how that would interact without some fragment hackery. > > On 2 March 2018 at 03:34, Jean-Baptiste Onofré < > jb@ > > wrote: > >> Thanks, please let me know if you have any issue. >> >> Regards >> JB >> >> On 03/02/2018 10:33 AM, munishgupta.asr wrote: >> > Thanks JB. >> > >> > I will try and get back with results. >> > >> > Regards >> > Munish >> > >> > >> > >> > -- >> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html >> > >> >> -- >> Jean-Baptiste Onofré >> > jbonofre@ >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > > > > -- > Matt Sicker < > boards@ > > Matt Sicker wrote > If you have a custom log4j 1 appender, there's limited support in > log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not > sure > how that would interact without some fragment hackery. > > On 2 March 2018 at 03:34, Jean-Baptiste Onofré < > jb@ > > wrote: > >> Thanks, please let me know if you have any issue. >> >> Regards >> JB >> >> On 03/02/2018 10:33 AM, munishgupta.asr wrote: >> > Thanks JB. >> > >> > I will try and get back with results. >> > >> > Regards >> > Munish >> > >> > >> > >> > -- >> > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html >> > >> >> -- >> Jean-Baptiste Onofré >> > jbonofre@ >>
Re: KARAF 4.1.5 & pax-logging-service
If you have a custom log4j 1 appender, there's limited support in log4j-1.2-api which you can add on to the log4j2 stuff, though I'm not sure how that would interact without some fragment hackery. On 2 March 2018 at 03:34, Jean-Baptiste Onofré wrote: > Thanks, please let me know if you have any issue. > > Regards > JB > > On 03/02/2018 10:33 AM, munishgupta.asr wrote: > > Thanks JB. > > > > I will try and get back with results. > > > > Regards > > Munish > > > > > > > > -- > > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html > > > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Matt Sicker
Re: KARAF 4.1.5 & pax-logging-service
Thanks JB. I will try and get back with results. Regards Munish -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
Re: KARAF 4.1.5 & pax-logging-service
Thanks, please let me know if you have any issue. Regards JB On 03/02/2018 10:33 AM, munishgupta.asr wrote: > Thanks JB. > > I will try and get back with results. > > Regards > Munish > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html > -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: KARAF 4.1.5 & pax-logging-service
Hi, no need to deal with logback (that's another layer). Correct for log4j2 attachment & style. Regards JB On 03/02/2018 10:20 AM, munishgupta.asr wrote: > Thanks for the quick response. > > we are extending the org.apache.log4j.FileAppender and > org.apache.log4j.nt.NTEventLogAppender. > for now, my fragment pom file is using service as host bundle. > > > ${project.artifactId} > > ${project.groupId}.${project.artifactId} > ${project.version} > com.good.gcs.core.logging > !* > > org.ops4j.pax.logging.pax-logging-service > <_failok>true > > > > > So that means I should update my fragment-host to "pax-logging-log4j2" and > updated appender to log4j2 style? > > what is the use of pax-logging-logback? Do i need to do anything with that > also? > > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html > -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: KARAF 4.1.5 & pax-logging-service
Thanks for the quick response. we are extending the org.apache.log4j.FileAppender and org.apache.log4j.nt.NTEventLogAppender. for now, my fragment pom file is using service as host bundle. ${project.artifactId} ${project.groupId}.${project.artifactId} ${project.version} com.good.gcs.core.logging !* org.ops4j.pax.logging.pax-logging-service <_failok>true So that means I should update my fragment-host to "pax-logging-log4j2" and updated appender to log4j2 style? what is the use of pax-logging-logback? Do i need to do anything with that also? -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html
Re: KARAF 4.1.5 & pax-logging-service
Hi, As we switched to log4j2 configuration style, we now use pax-logging-log4j2. pax-logging-log4j2 replaces the pax-logging-service (log4j1 style) implementation of pax-logging-api. I guess you use a fragment to use a log4j appender ? If so, you should update your appender to log4j2 style and attach to pax-logging-log4j2. Even better is to implement your PaxAppender (based on the pax-logging-api). Regards JB On 03/02/2018 09:58 AM, munishgupta.asr wrote: > Hi All, > > for our project, we are using KARAF 4.0.9 for now and decided to upgrade it > to 4.1.5. > we have a customer appender which is used as a fragment with > pax-logging-service bundle. > > After upgrading to KARAF 4.1.5, it is failing to find pax-logging-service > and service is not getting downloaded in system folder using maven. rather > I could see 2 different folders in system path. > Pax-logging-logback > pax-logging-log4j2 > > have we removed support of pax-logging-service with KARAF 4.1.x onwards. > What shall i use now as fragment-host bundle to get the build generated? > > Regards > > Munish > > > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html > -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
KARAF 4.1.5 & pax-logging-service
Hi All, for our project, we are using KARAF 4.0.9 for now and decided to upgrade it to 4.1.5. we have a customer appender which is used as a fragment with pax-logging-service bundle. After upgrading to KARAF 4.1.5, it is failing to find pax-logging-service and service is not getting downloaded in system folder using maven. rather I could see 2 different folders in system path. Pax-logging-logback pax-logging-log4j2 have we removed support of pax-logging-service with KARAF 4.1.x onwards. What shall i use now as fragment-host bundle to get the build generated? Regards Munish -- Sent from: http://karaf.922171.n3.nabble.com/Karaf-Dev-f930721.html