Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-2171

LogMessage mailet improvments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • master
    • None
    • Mailet Contributions

    Description

      Today, one can use the LogMessage to generate log messages upon mail reception

      But the LogMessage have the following limits:

      • It do not let you configure the warn level
      • It does generate several logs. One would be simpler to review.
      • It does add some unneeded informations, like mail name already carried by the MDC
      • It does not allow logging of specific headers or specific attributeNames. This leads to missing information as well as "to much information".
      • The code quality of the mailet is poor.

      You will:

      • Ensure a single log message will be generated. For this you will call the logger one time and concatenate log messages parts.
      • Remove the log line with mail name.
      • Add a *level* configuration option. It can takes value *warn, **info, **debug* or *error*. It will be used to set the logger log level.
      • Add a *specificHeaders* configuration option. It takes a comma separated list of header names to include in the log message. By default it is empty.
      • Add a *specificAttributes* configuration option. It takes a comma separated list of attribute names to be included in the log message. By default it is empty.
      • *body* configuration option should be false by default
      • *header* configuration option should be false by default
      • *init* should propagate exception while initilizing (Integer parse exception, also passing a negative max body should throw.)
      • Remove inlined affectation for field. They can be unset on their declaration and set when init is called.

      Correct LogMessageTest accordingly.

      Don't hesitate to reach us on the gitter chat if you have any question.

      Attachments

        Activity

          People

            Unassigned Unassigned
            btellier Benoit Tellier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h