Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-7226

Context based log filtering with log4j-1.2.x

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 2.24.04
    • None
    • None

    Description

      Even though the current logging configuration in archetype is designed to keep context-based separate log files (e.g, hippo-cms.log for cms/repo application and hippo-site.log for site application), the current solution doesn't seem to provide the designed feature property.
      For example, if you use hippo-repository-connector classes in an HST component, then you will see the logs generated by the
      hippo-repository-connector classes in the hippo-cms.log file, not in the hippo-site.log file because default configuration for log4j is not so flexible and so it is strictly tied to the class/package names only.

      ------------------------------------

      We can do the following with log4j:

      • Add a simple MDC or JNDI based Filter in a hippo shared lib (See
        'Log4JMDCFilter' example in [1] for detail).
        (hippo-cms7-commons-x.x.x.jar)
      • I think JNDI based resource configuration should be better because it's safer in a separate thread as well.
      • Set JNDI resource property in each web.xml
      • Configure 'conditional logging' in the existing log4j.xml.

      Attachments

        Issue Links

          Activity

            People

              jsheriff Junaidh Kadhar Sheriff
              wko Woonsan Ko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: