Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-3902

Add formal message categories to C++ Broker log messages

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.17
    • C++ Broker
    • None

    Description

      This is a proposal to add log categories to C++ Broker log messages.

      Problem Statement

      There are difficulties working with C++ Broker logging when appplying a log filter criterion. What precise FILTERTEXT can a user specify for:

      --log-enable debug+:FILTERTEXT
      

      Even after the fix from QPID-3891 it is not intuitive what to specify for a FILTERTEXT and any useful filter requires detailed knowledge of the source code.

      Proposal

      A log category is a high-level classification of the nature of the logged event that is not tied to a particular source module or code function name. This log category would become the target for FILTERTEXT log filters.

      The following list is the proposed log category definition. Each log category name is followed by a list of source code directory names that would generally produce logs using that log category.

      Category Source code directory
      Security acl ssl gssapi sasl cyrus
      Broker broker
      Management agent console qmf
      Amqp amqp_0_10 framing
      System log sys types xml thread mutex fork pipe time ...
      HA cluster ha replication
      Messaging messaging client
      Store store
      IO tcp rdma AsynchIO socket epoll
      Test  
      Unspecified  

      There is no strict rule that a module produce only log entries of a specific category.

      The category would be inserted into each log message after the time of day but before the message text.

      2012-03-06 16:55:38 [Management] SEND PackageInd package=org.apache.qpid.broker to=schema.package
      

      A user could then filter log messages by using the category names:

      --log-enable debug+:Management
      

      This scheme would have a number of benefits:

      1. On a per-message basis the filter comparisons would be using enumeration values and not strings.
      2. The feature could be documented sensibly.
      3. Log files would be easier to interpret manually or by event management systems.

      The classifications could be phased in gradually. The current
      QPID_LOG(LEVEL, MESSAGE) would produce [Unspecfied] events while the new
      QPID_LOG_CAT(LEVEL, CATEGORY, MESSAGE) would produce events using an actual category.
      Similar additions are made for the QPID_MSG entries.

      Attachments

        1. qpid-log-src-tabbed2.txt
          123 kB
          Charles E. Rolke

        Activity

          People

            Unassigned Unassigned
            chug Charles E. Rolke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: