Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5078439

controlling the Level of entering, exiting, and throwing log messages

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Future Project
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs



      Name: gm110360 Date: 07/26/2004


      A DESCRIPTION OF THE REQUEST :
      The Levels provided by the Logger class are rich enough
      for my model of logging, and the entering and exiting methods
      are convenient enough to get frequent use. The problem is
      that the entering and exiting methods log at the wrong level.
      They log FINER, and they should log FINEST.

      I would like to see an enhancement to the Logger class
      that lets me set the Levels. Perhaps these new methods:

      setEnteringLevel(Level);
      setExitingLevel(Level);
      setThrowingLevel(Level);

      Another solution would be to introduce a new Level between CONFIG and FINE; then I could ignore FINEST and still have a rich let of Levels.

      JUSTIFICATION :
      One would like to encourage developers to use entering and exiting
      logging, but except during development, these make for very verbose
      logs.

      Frequent, verbose logs must be below the CONFIG level. That
      leaves only three levels: FINE (for significant program actions and flow),
      FINER (for debugging statements of use to the developer), and FINEST (for verbose messages that you can't leave turned on). Clearly method
      entering and exiting is in the later category.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      two logging levels between CONFIG and the level at which entering and exiting log.
      ACTUAL -
      only one logging level available between CONFIG and the level at which entering and exiting log.

      CUSTOMER SUBMITTED WORKAROUND :
      As a work around, I am trying to subclass Logger and override
      the entering and exiting methods. But Logger is hard to subclass.
      The subclassing issue could be an entire bug report on its own.
      (Incident Review ID: 286965)
      ======================================================================

            Unassigned Unassigned
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: