Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9773

logging does not work for OSGI bundles



    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • 21.0.0, 21.0.1, 21.0.3
    • 21.0.4
    • OSGi
    • Security Level: Default (Default Security Scheme)
    • Horizon - Jan 10th 2018, Horizon - Jan 17th 2018, Horizon - Jan 24th 2018


      No debug or error logs appear to be being created for bundles using slf4j logging loaded into OpenNMS 21.0.0 running karaf 4.1.2 with the upgrade to log4j2.

      This relates to changes to using log4j2 when upgrading to karaf 4.1.2

      https://github.com/OpenNMS/opennms/pull/1698 HZN-1092: Upgrade to Karaf 4.1.2

      This may be related to ClassNotFoundException for org.apache.logging.log4j.core.util.ExecutorServices in output.log  NMS-9695

      (Note surprisingly bundles which log using jdk or jcl logging do appear to generate logs in karaf.log)

      I have created a small test bundle (source and jar attached) which can be dropped into the deploy directory

      This repeatedly outputs message to System.out, DEBUG,ERROR. The System.out messages show up in output.log but no other log messages are created.

      Note that this bundle works as expected  in OpenNMS versions prior to 21.0.0 and in stand alone karaf 4.1.2 installations.

      I did think that there might be a class path issue with having log4j 2 in the lib directory. I have tried to add log4j2 classes to opennms custom.properties but so far this has not worked

      So far I am left scratching my head and unable to get debug messages for karaf deployed bundles


        Issue Links



              seth Seth Leger
              cgallen Craig Gallen
              0 Vote for this issue
              4 Start watching this issue