Anatoliy Balakirev created KARAF-4772: -----------------------------------------
Summary: Karaf ignores log4j2 config Key: KARAF-4772 URL: https://issues.apache.org/jira/browse/KARAF-4772 Project: Karaf Issue Type: Bug Affects Versions: 4.0.7, 4.0.6, 4.0.5, 4.0.4 Reporter: Anatoliy Balakirev I'm trying to switch my project to log4j2 and karaf seems to be just ignoring my config: I see some my messages (WARN level and higher) are logged to console only. Log4j2 configuration itself looks ok. When I initially made some mistake there (left old appender from log4j1) - got following error: {noformat} 2016-10-15 21:04:32,172 CM Configuration Updater (Update: pid=org.ops4j.pax.logging) ERROR Appenders contains an invalid element or attribute "appender" {noformat} So looks like my config is picked up (I fixed it eventually for sure), but still ignored somehow. Googling gave me this open question on stackoverflow: http://stackoverflow.com/questions/37213432/karaf-4-0-5-with-log4j2-my-bundle-log-output-always-in-console-but-should-be-in I had the same with karaf 4.0.4, 4.0.5, 4.0.6 and now 4.0.7. However, with 4.0.4 and 4.0.5 nothing was printed to my appenders, with 4.0.6 and 4.0.7 I'm getting some internal karaf's messages logged there: {noformat} 2016-10-15T21:12:40,676 [INFO] [org.apache.aries.jmx.core] [] [] [FelixStartLevel] - Registering MBean with ObjectName [osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f] for service with service.id [18] 2016-10-15T21:12:41,942 [INFO] [org.apache.aries.jmx.core] [] [] [pool-39-thread-1] - Registering org.osgi.jmx.framework.FrameworkMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@54592ffa with name osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f 2016-10-15T21:12:41,945 [INFO] [org.apache.aries.jmx.core] [] [] [pool-39-thread-1] - Registering org.osgi.jmx.framework.ServiceStateMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@54592ffa with name osgi.core:type=serviceState,version=1.7,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f 2016-10-15T21:12:41,947 [INFO] [org.apache.aries.jmx.core] [] [] [pool-39-thread-1] - Registering org.osgi.jmx.framework.wiring.BundleWiringStateMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@54592ffa with name osgi.core:type=wiringState,version=1.1,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f 2016-10-15T21:12:41,948 [INFO] [org.apache.aries.jmx.core] [] [] [pool-39-thread-1] - Registering org.osgi.jmx.framework.PackageStateMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@54592ffa with name osgi.core:type=packageState,version=1.5,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f 2016-10-15T21:12:41,948 [INFO] [org.apache.aries.jmx.core] [] [] [pool-39-thread-1] - Registering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@54592ffa with name osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f 2016-10-15T21:12:41,950 [INFO] [org.apache.aries.jmx.core] [] [] [pool-39-thread-1] - Registering org.osgi.jmx.framework.BundleStateMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@54592ffa with name osgi.core:type=bundleState,version=1.7,framework=org.apache.felix.framework,uuid=c90c3d97-96e9-4718-950e-84243e98fc8f ... 2016-10-15T21:12:43,862 [DEBUG] [com.ubs.b2c.derivspne.datastore.api] [] [] [FelixStartLevel] - BundleEvent RESOLVED - my.bundle.name1 2016-10-15T21:12:43,962 [DEBUG] [com.ubs.b2c.derivspne.levitas.impl] [] [] [FelixStartLevel] - BundleEvent RESOLVED - my.bundle.name2 2016-10-15T21:12:43,996 [DEBUG] [com.ubs.b2c.derivspne.datastore.impl] [] [] [FelixStartLevel] - BundleEvent RESOLVED - my.bundle.name3 2016-10-15T21:12:45,893 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.apache.felix.framework 2016-10-15T21:12:45,893 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.apache.felix.framework 2016-10-15T21:12:45,893 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.ops4j.pax.logging.pax-logging-api 2016-10-15T21:12:45,893 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.ops4j.pax.logging.pax-logging-api 2016-10-15T21:12:45,894 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.ops4j.pax.logging.pax-logging-log4j2 2016-10-15T21:12:45,897 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.ops4j.pax.logging.pax-logging-log4j2 2016-10-15T21:12:45,898 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.apache.felix.configadmin 2016-10-15T21:12:45,898 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.apache.felix.configadmin 2016-10-15T21:12:45,898 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.apache.felix.fileinstall 2016-10-15T21:12:45,898 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.apache.felix.fileinstall 2016-10-15T21:12:45,898 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.apache.felix.metatype 2016-10-15T21:12:45,898 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.apache.felix.metatype 2016-10-15T21:12:45,899 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.apache.karaf.services.eventadmin 2016-10-15T21:12:45,899 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.apache.karaf.services.eventadmin 2016-10-15T21:12:45,899 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - Bundle Considered for SPI providers: org.ops4j.pax.url.mvn 2016-10-15T21:12:45,899 [INFO] [org.apache.aries.spifly.dynamic.bundle] [] [] [FelixStartLevel] - No 'SPI-Provider' Manifest header. Skipping bundle: org.ops4j.pax.url.mvn ... 2016-10-15T21:12:55,079 [DEBUG] [...] [] [] [SpringOsgiExtenderThread-37] - ServiceEvent REGISTERED - [MyServiceName] - my.bundle.name {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)