You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Claude Brisson (JIRA)" <ji...@apache.org> on 2016/09/10 15:42:20 UTC

[jira] [Resolved] (VELOCITY-719) Unwritable velocity.log appears to cause Velocity initialization to fail, leaving velocity dead and useless.

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

Claude Brisson resolved VELOCITY-719.
-------------------------------------
       Resolution: Fixed
         Assignee: Claude Brisson
    Fix Version/s: 2.x

Since Velocity 2.x has switched to SLF4J, Velocity doesn't try itself to create any log file.

When no binding is present in the classpath, the default behavior is the following: SLF4J will log a warning message on the standard error stream, and use a NOP loader.


> Unwritable velocity.log appears to cause Velocity initialization to fail, leaving velocity dead and useless. 
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-719
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-719
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Cott Lang
>            Assignee: Claude Brisson
>             Fix For: 2.x
>
>
> When we upgraded to 1.6.2 from 1.5.0, we began experiencing failures:
> Caused by: java.lang.NullPointerException
>  at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1400)
>  at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:326)
>  at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:352)
> We eventually traced this back to Log4JChute attempting to create velocity.log in an unwritable $CWD.
> I realize you may or may not consider this a bug, as you may wish to have the system fail if it can't log.  However, I couldn't even find any output indicating the initial failure to create velocity.log causing Velocity to fail to initialize. :)
> On a related note, is it possible to change the runtime.log default to BLANK so that velocity defaults to using a pre-existing log4j config if it exists?
> Although it's certainly an established tradition at this point, It seems a little backward to default to creating it's own log4j configuration - and a google search on velocity.log produces a very large number of people dealing with the problem of Velocity trying to create a velocity.log somewhere that doesn't work. :)



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org