You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Daniel Dekany (JIRA)" <ji...@apache.org> on 2015/10/28 08:50:27 UTC

[jira] [Commented] (FREEMARKER-5) Suppress logging of exceptions

    [ https://issues.apache.org/jira/browse/FREEMARKER-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14977918#comment-14977918 ] 

Daniel Dekany commented on FREEMARKER-5:
----------------------------------------

There's a setting for that, `Configuration.setLogTemplateExceptions(boolean)`. Does that cover what you need?

I'm curious what's the use case. While you can catch the exceptions thrown by `Template.process`, `#attempt`/`#recover` will still threat them as errors. Probably you don't use those directives, I just wonder what the real solution would be, if the use case is something that others need too.

> Suppress logging of exceptions
> ------------------------------
>
>                 Key: FREEMARKER-5
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-5
>             Project: Apache Freemarker
>          Issue Type: Wish
>            Reporter: Roli Züger
>
> According to the documentation all exceptions are logged. Even if there is a special TemplateExceptionHandler, logging of a certain exception cannot be suppressed.
> (see also freemarker.core.Environment#handleTemplateException)
> At some points we want to exit the template rendering process by throwing an exception (from our TemplateDirectiveModel implementations). We're handling these exceptions later and don't want them to clutter the log files.
> Documentation: http://freemarker.org/docs/pgui_config_errorhandling.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)