Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4271

Improve loggign level in JSONUtil to avoid excessive logs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.3.16
    • 2.3.20
    • Plugin - JSON
    • None

    Description

      The JSON result type generates excessive logs when used in debug mode, since it shows a log for each pattern defined in the result, and a log for the final result. For example:

      DEBUG org.apache.struts2.json.JSONUtil - Adding include property expression: actionMessages.*
      DEBUG org.apache.struts2.json.JSONUtil - Adding include property expression: actionResult
      DEBUG org.apache.struts2.json.JSONUtil - Adding include property expression: data.*
      DEBUG org.apache.struts2.json.JSONUtil - Adding include property expression: fieldErrors.*
      DEBUG org.apache.struts2.json.JSONUtil - [JSON]{"actionMessages":[],"actionResult":"success","data":{},"fieldErrors":{}}

      It would be better to change the level used in the method addPattern to trace, since in debug mode the final result is quite more useful than the "Adding include". I'm attaching a patch for this.

      Attachments

        1. WW-4271.patch
          0.9 kB
          Jose L Martinez-Avial

        Activity

          People

            lukaszlenart Lukasz Lenart
            jlmagc Jose L Martinez-Avial
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: