Uploaded image for project: 'XWork'
  1. XWork
  2. XW-613

OgnlValueStack logging levels are backwards



    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.1.2
    • None
    • None


      In the OgnlValueStack class, when exceptions from Ognl are thrown the logging level that is used is debug. On the flip-side when a property or method could not be found, the logging level is warning. These seem backwards for this reason:

      • Exceptions that are throw when Ognl invokes a JavaBean property or a method are application problems that need to be fixed. This might be a null pointer or another type of runtime exception. It could also be a checked exception that just isn't being properly handled. Therefore, the logging for these should be controlled at the warning level and the developer should have to set the logging level for the OgnlValueStack class to something very high (SEVERE) to get rid of them. Therefore, if these errors occur in production, the developer has to have access to stack traces so that they can fix them. Therefore, the logging level must be set such that these are written to the logs, with stack traces, by default.
      • For Struts applications, when a property or method isn't found, it can often be caused by objects in the HTTP request whose keys don't directly map to JavaBean properties on the action. This are rarely errors and can often not be fixed. If the user wants to see that a property is missing, it should probably need to set the logging level to debug and probably have devMode on. When the application is in production, these messages should not ever go to the logs because it will completely spam the log files.




            rainerh Rainer Hermanns
            voidmain Brian Pontarelli
            0 Vote for this issue
            0 Start watching this issue