Uploaded image for project: 'Log4php'
  1. Log4php
  2. LOG4PHP-67

Refactoring: Use Logger instead of LoggerManager

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • Code
    • None

    Description

      Reading: http://logging.apache.org/log4j/1.2/manual.html

      While Log4PHP is always speaking of LoggerManager::getLogger, Log4J
      uses: Logger.getLogger.
      There is actually a LogManager class available in Log4J, but I couldn't
      find any reference from the documentation to it. I guess it's the
      preferred way of Log4J to use Logger.getLogger().

      In Log4php you can currently use Logger class to retrieve a logger. Is
      redirecting this request to the loggerManager, which returns the
      LoggerHierarchy which returns the actual logger.

      You can also use the LoggerManager directly to retrieve a Logger.

      This is confusing. What should one use? Why two ways? I hardly see a
      benefit in having the LoggerManager class. Its just defining the
      classloader and references to the LoggerHierarchy.

      As discussed on the mailinglist, LoggerManager should be removed and Logger class
      should be used instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            grobmeier Christian Grobmeier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: