[jira] Created: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
Eliminate redundant log messages in screen widgets
--------------------------------------------------

                 Key: OFBIZ-1169
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
    Affects Versions: SVN trunk
            Reporter: Leon Torres
             Fix For: SVN trunk


Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.

I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.



--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon Torres updated OFBIZ-1169:
-------------------------------

    Attachment: screenwidget-log-fix.patch

This patch provides two major improvements to the readability of screen widget logs.

1.  The render screen function is recursive in nature, and each render step will log every error.  Most of these errors get thrown up to the previous render function, which causes them to get logged again.  This is the primary reason that the log file explodes with messages.

To fix it, I introduced a special exception called ScreenRenderException which tells the rendering function that the particular error was already caught and logged, so it can just pass it up the chain.

2.  HtmlWidget.java was throwing a RuntimeException, which pollutes the user's screen with a lot of error information.  Instead of throwing RuntimeException, just render the error message directly to the screen.  This is much more useful as it prints exactly what the error was and nothing more, allowing you to fix typos in the FTL much faster.

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>             Fix For: SVN trunk
>
>         Attachments: screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Si Chen reassigned OFBIZ-1169:
------------------------------

    Assignee: Si Chen

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon Torres updated OFBIZ-1169:
-------------------------------

    Attachment: screen-render-exception.patch

Oops, forgot to svn add the ScreenRenderException so I can diff it.  The second patch contains the new exception file, which is simply a subclass of GeneralException.

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514688 ]

Si Chen commented on OFBIZ-1169:
--------------------------------

If there are no objections I will commit this.

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514694 ]

Adrian Crum commented on OFBIZ-1169:
------------------------------------

I don't have time to review the patch, but I like the idea.

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514712 ]

David E. Jones commented on OFBIZ-1169:
---------------------------------------

For anything like this please allow at least a couple of days for review before committing. If it was an urgent bug fix or something that would be different, but with a little time more of the general group using OFBiz might be able to review, comment on, and help improve this.

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12514737 ]

Leon Torres commented on OFBIZ-1169:
------------------------------------

Yes, please test.  It's pretty easy to: just introduce typos into the FTL and bsh files and see what shows up in the log and on screen. :-)

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515014 ]

Si Chen commented on OFBIZ-1169:
--------------------------------

I won't commit this until Friday so anybody who has a comment or suggestion please chime in.

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515078 ]

Jacques Le Roux commented on OFBIZ-1169:
----------------------------------------

I can't see any differences for .bsh (tried just to remove a semi-colon) but for .ftl yes it's really smarter. The code seems sound : I vote for

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515080 ]

Leon Torres commented on OFBIZ-1169:
------------------------------------

Oh yeah, I forgot to mention that BshUtil.java is a little noisy, because it both logs the exception and throws it, causing redundant messages.  I just shut it off in debug.properties:

log4r.logger.org.ofbiz.base.util=OFF

Try this patch with this logger setting and it should be more concise. :-)

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515197 ]

Jacques Le Roux commented on OFBIZ-1169:
----------------------------------------

Sorry Leon,

I added "log4r.logger.org.ofbiz.base.util=OFF" in debug.properties. I still can't see any differences

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515452 ]

Si Chen commented on OFBIZ-1169:
--------------------------------

Leon,

Generally this is a great helper and has significantly cut down on the error messages thrown.  However, one problem is that the exception message no longer tells you the full location of the file.  For example, I get this:

2007-07-25 16:26:15,598 (http-0.0.0.0-8433-Processor4) [ Log4JLoggerFactory.java:96 :ERROR]
Expression haha is undefined on line 64, column 31 in viewprofile.ftl.
The problematic instruction:
----------
==> ${haha} [on line 64, column 29 in viewprofile.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression haha is undefined on line 64, column 31 in viewprofile.ftl.

But which viewprofile.ftl?  It would be helpful if it could say component://.../viewprofile.ftl

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515455 ]

Si Chen commented on OFBIZ-1169:
--------------------------------

Oops I found it below:
2007-07-25 16:48:17,079 (http-0.0.0.0-8433-Processor4) [         HtmlWidget.java:87 :ERROR]
---- exception report ----------------------------------------------------------
Error rendering included template at location [component://crmsfa/webapp/crmsfa/contactmech/viewprofile.ftl]: freemarker.core.InvalidReferenceException: Expression haha is undefined on line 64, column 3 in viewprofile.ftl.
Exception: freemarker.core.InvalidReferenceException
Message: Expression haha is undefined on line 64, column 3 in viewprofile.ftl.
---- stack trace ---------------------------------------------------------------

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-1169) Eliminate redundant log messages in screen widgets

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-1169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Si Chen closed OFBIZ-1169.
--------------------------

    Resolution: Fixed

> Eliminate redundant log messages in screen widgets
> --------------------------------------------------
>
>                 Key: OFBIZ-1169
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1169
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Assignee: Si Chen
>             Fix For: SVN trunk
>
>         Attachments: screen-render-exception.patch, screenwidget-log-fix.patch
>
>
> Currently, if you have a typo or minor bug in a bsh or ftl file that is part of a screen widget definition, the resulting error message in the log and on screen can be overwhelming.  This causes a serious usability issue with developers and new users.
> I decided to spend some personal time to see what the source of the log "explosion" is and how it can be fixed.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.