RES: disable logging
Gabriel Luhers Graça <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
I get tons of this:
15/08/2008 10:14:56 freemarker.log.JDK14LoggerFactory$JDK14Logger error
SEVERE:
Expression repassador is undefined on line 279, column 103 in modelo.
The problematic instruction:
----------
==> ${repassador.nome} [on line 279, column 101 in modelo]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression repassador is undefined on line 279, column 103 in modelo.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
Performance is not an issue, but I would like my logs to be leaner. I only need to know which expression caused the problem, not have the whole stack trace.
Thanks,
Gabriel.
-----Mensagem original-----
De: [email protected] [mailto:[email protected]] Em nome de Daniel Dekany
Enviada em: quinta-feira, 14 de agosto de 2008 20:53
Para: Jonathan Revusky
Cc: FreeMarker-user
Assunto: Re: [FreeMarker-user] disable logging
Friday, August 15, 2008, 12:07:19 AM, Jonathan Revusky wrote:
> You could always just comment out the lines that are producing the
> excessive logging in the freemarker source and rebuild the
> freemarker.jar,
Was that a joke?
BTW, what is in those log messages? I think they shouldn't occur if
you set logger to LIBRARY_NONE.
BTW 2, a "Configuration cfg= new Configuration()" per each
template.proccess is slow, but maybe it was like that only for the
sake of experiment.
> On Thu, Aug 14, 2008 at 2:43 PM, Gabriel Luhers Graça
> <[email protected]> wrote:
>> Hi all,
>>
>> I'm using freemarker along with struts2 and can't turn off the enormous stack traces that are printed on stdout.
>>
>> My code goes like this:
>>
>> freemarker.log.Logger.selectLoggerLibrary(freemarker.log.Logger.LIBRARY_NONE);
>> Configuration cfg= new Configuration();
>> cfg.setObjectWrapper(new DefaultObjectWrapper());
>> cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER);
>> Template template=new Template("modelo", new java.io.StringReader(buffer.toString()), cfg);
>> Writer out=new StringWriter();
>> Map root=criarVariaveis();
>> template.process(root, out);
>> out.flush();
>>
>> I thought the first line would do the trick, but it doesn't have any effect.
>>
>> I would also like to leave the offending expressions on the processed document, but I've found no simple to way to extract it from the exceptions
>> (except for extricating from the message string with a regex). Is there a simpler way?
>>
>> Thanks,
>>
>> Gabriel.
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> FreeMarker-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
--
Best regards,
Daniel Dekany
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/