Karaf
  1. Karaf
  2. KARAF-543

Add manual section around log custom appenders

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.2, 3.0.0
    • Component/s: karaf-documentation
    • Labels:
      None

      Description

      To be able to add custom appenders to PAX Logging, a fragment bundle is required with:

      Fragment-Host = org.ops4j.pax.logging.pax-logging-service

      A section of the Karaf dev manual should document that.

      The PAX Logging wiki should be update as well (I will).

      1. KARAF-543-2.patch
        2 kB
        Christian Schneider
      2. KARAF-543.patch
        2 kB
        Christian Schneider

        Activity

        Hide
        Andreas Pieber added a comment -

        JB, do you plan to fix this in the near future? Otherwise I think we can delay this to 2.2.2 (at least since we can push the manual independent of the karaf-version to the site any way)

        Show
        Andreas Pieber added a comment - JB, do you plan to fix this in the near future? Otherwise I think we can delay this to 2.2.2 (at least since we can push the manual independent of the karaf-version to the site any way)
        Hide
        Jean-Baptiste Onofré added a comment -

        It's not blocker for Karaf 2.2.1 so I delayed to 2.2.2.

        Show
        Jean-Baptiste Onofré added a comment - It's not blocker for Karaf 2.2.1 so I delayed to 2.2.2.
        Hide
        Christian Schneider added a comment -

        I think using a fragment bunlde should only be a last resort. I propose that pax logging could look for osgi services of the type org.ops4j.pax.logging.spi.PaxAppender. A service property could name the appender or bind it to a logger.

        Show
        Christian Schneider added a comment - I think using a fragment bunlde should only be a last resort. I propose that pax logging could look for osgi services of the type org.ops4j.pax.logging.spi.PaxAppender. A service property could name the appender or bind it to a logger.
        Hide
        Achim Nierbeck added a comment -

        A custom appender usually is in need of a Appender class which is only available from the bundle in question, therefore a service solution is not really possible, and fragment bundles are meant to be used that way. What you do here is to improve the standard with enhancements.

        Show
        Achim Nierbeck added a comment - A custom appender usually is in need of a Appender class which is only available from the bundle in question, therefore a service solution is not really possible, and fragment bundles are meant to be used that way. What you do here is to improve the standard with enhancements.
        Hide
        Guillaume Nodet added a comment -

        There are two kind of appenders:

        Show
        Guillaume Nodet added a comment - There are two kind of appenders: pax-logging appenders such as http://svn.apache.org/repos/asf/karaf/trunk/shell/log/src/main/java/org/apache/karaf/shell/log/VmLogAppender.java can be registered in OSGi and referenced in the log4j configuration using osgi:* custom log4j appenders need to use fragments as the log4j backend isn't exposed publicly
        Hide
        Christian Schneider added a comment -

        The section about adding a log4j appender looks already complete.

        • Fixed the logging file name for the karaf log comannds config
        • Moved the configuration file for the log commands to the description of the log commands so it is easier to understand in what context it is used
        Show
        Christian Schneider added a comment - The section about adding a log4j appender looks already complete. Fixed the logging file name for the karaf log comannds config Moved the configuration file for the log commands to the description of the log commands so it is easier to understand in what context it is used
        Hide
        Jean-Baptiste Onofré added a comment -

        I move this issue on Karaf 2.2.2. I applied the Christian's patch but I think that we have to add deeper explanations on "Using your own appenders" section.

        Show
        Jean-Baptiste Onofré added a comment - I move this issue on Karaf 2.2.2. I applied the Christian's patch but I think that we have to add deeper explanations on "Using your own appenders" section.
        Hide
        Christian Schneider added a comment -

        If you can give me a rough overview what should be handled I can write the documentation

        Show
        Christian Schneider added a comment - If you can give me a rough overview what should be handled I can write the documentation
        Hide
        Christian Schneider added a comment -

        Added details on how to implement appenders. Corrected broken link to pax logging

        Show
        Christian Schneider added a comment - Added details on how to implement appenders. Corrected broken link to pax logging
        Hide
        Achim Nierbeck added a comment -

        applied patch of Christian

        trunk: 1128071
        2.2.x-branch: 1128073

        Show
        Achim Nierbeck added a comment - applied patch of Christian trunk: 1128071 2.2.x-branch: 1128073
        Hide
        Jamie goodyear added a comment -

        Fixed in Apache Karaf 2.2.2.

        Show
        Jamie goodyear added a comment - Fixed in Apache Karaf 2.2.2.

          People

          • Assignee:
            Achim Nierbeck
            Reporter:
            Jean-Baptiste Onofré
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development