[ 
http://issues.apache.org/jira/browse/VELOCITY-157?page=comments#action_12330833 
] 

Nathan Bubna commented on VELOCITY-157:
---------------------------------------

here's the new change log.  patch will follow shortly.

Changes in this patch:

Added LogChute interface:
    - same as old LogSystem but
        - removed DEBUG_ON constant
        - renamed logVelocityMessage(...) to log(...)
        - added isLevelEnabled(int level)
        - added log(int level, String message, Throwable t)
        - added TRACE_ID constant

Added new LogChute implementations:
    - JdkLogChute for the java.util.logging services in JDK 1.4+
    - StandardOutLogChute for printing logging to System.out and System.err
    - HoldingLogChute to replace PrimordialLogSystem
    - Log4JLogChute to replace Log4JLogSystem and SimpleLog4JLogSystem
    - NullLogChute to replace NullLogSystem
    - AvalonLogChute to replace AvalonLogSystem
    - LogChuteSystem to wrap user's LogSystem implementations

Changed TestCases that implemented LogSystem over to LogChute
    - ClassloaderChangeTestCase
    - EventHandlingTestCase
    - ExternalLoggerTestCase
    - FilteredEventHandlingTestCase

Deprecated LogSystem interface

Deprecated existing LogSystem implementations:
    - made them extend their new LogChute replacements
    - redirect messages from logVelocityMessage(level,message) to 
log(level,message)
    - emptied out pretty much everything else

Added new Log class:
    - Log class is meant to replace RuntimeLogger interface
    - also added temporary RuntimeLoggerLog hack as deprecation path
    - Log class provides more convenience methods for LogChute functions
    - Log class takes over some logging code from RuntimeInstance
    - Log instance may be retrieved from RuntimeServices.getLog()

Upgraded LogManager:
    - s/createLogSystem/createLogChute
    - if user's pass in LogSystems instead of LogChutes
        - wrap them using LogChuteSystem
        - log a warning
    - createLogChute(...) now falls back to StandardOutLogChute on failure
    - added updateLog(...) to take over Log initialization code from 
RuntimeInstance

Updated RuntimeInstance:
    - moved logging init code to LogManager and Log
    - deprecated debug(Object), info(Object), warn(Object), and error(Object)
    - added getLog()
    - removed private methods showStackTraces() and log(...)
    - replaced private LogSystem instance with Log instance
    - replaced initializeLogger() with simpler initializeLog() code
    - passed Log to new Introspector instead of self

Updated RuntimeServices interface:
    - added getLog() method

Updated default velocity.properties:
    - added JdkLogChute as last option of runtime.log.logsystem.class property
    - remove unsupported log4j config example properties (were these ever 
supported?)

Updated UberspectLoggable interface:
    - deprecated setRuntimeLogger(RuntimeLogger)
    - added setLog(Log)
    - updated UberspectImpl to reflect these changes
    - all uberspects on the wiki extend UberspectImpl so these changes won't 
break them
    - this is easy for other uberspects to impl; Uberspect writers are very 
capable

Updated classes that directly use RuntimeLogger (*Executors and Introspector):
    - deprecated ctors that take RuntimeLogger
    - added ctors that take Log
    - deprecated ctors forward to new ctor using RuntimeLoggerLog hack
    - replaced RuntimeLogger refs with Log refs

Updated internal classes to use new logging API:
    - replace calls to RuntimeServices.debug/info/warn/error with 
RuntimeService.getLog()...
    - if log messages included an Exception, pass that separately now (i.e. 
error("Oops!", ex);)
    - logging was frequently used in a class/subclasses, add a Log reference
    - if the classes uses few log statements, just 
s/rsvc.<level>/rsvc.getLog().<level>
    - classes affected are:
        Template, VelocimacroFactory, Parser, SimpleNode, ContentResource,
        ResourceLoader, VelocimacroManager, VelocimacroProxy, ASTStringLiteral,
        ASTIdentifier, ASTMethod, ASTReference, ASTSetDirective, ASTAndNode,
        ASTEQNode, ASTNENode, ASTLTNode, ASTGTNode, ASTLENode, ASTGENode,
        ASTAddNode, ASTSubtractNode, ASTMulNode, ASTDivNode, ASTModNode,
        EventHandlerUtil, EscapeReference, IncludeNotFound, VMProxyArg, Foreach,
        Include, Macro, Parse, ASTIntegerRange, ClasspathResourceLoader,
        DataSourceResourceLoader, RuntimeInstance, ResourceCacheImpl,
        ResourceManagerImpl, ResourceLoader, FileResourceLoader, JarHolder,
        JarResourceLoader, ASTIntegerRange, ResourceLoaderFactory

Bugs fixed or obviated in this patch:
http://issues.apache.org/jira/browse/VELOCITY-159
http://issues.apache.org/jira/browse/VELOCITY-78
http://issues.apache.org/jira/browse/VELOCITY-193
http://issues.apache.org/jira/browse/VELOCITY-157
http://issues.apache.org/jira/browse/VELOCITY-403


> velocityEngine.init opens velocity.log multiple times
> -----------------------------------------------------
>
>          Key: VELOCITY-157
>          URL: http://issues.apache.org/jira/browse/VELOCITY-157
>      Project: Velocity
>         Type: Bug
>   Components: Source
>     Versions: 1.3.1-rc2
>  Environment: Operating System: All
> Platform: PC
>     Reporter: Hendrik Brummermann
>     Priority: Critical
>      Fix For: 1.5
>  Attachments: Test.java
>
> velocityEngine.init opens velocity.log multiple times   Every call to 
> velocityEngine.init() opens velocity.log several times. Frequent calls to 
> .init() (e.g. in doGet/doPost) will use up all file descriptors of the 
> operation system.  This is a critical problem because Windows 2000 deletes 
> all files that a process wants to open after Windows has no more file 
> descriptors left. (On Windows NT 4.0 you get "Too many open files" and 
> nothing is deleted)   Steps to reproduce: 1. java Test (see attachment) 2. 
> While Test is still running do:  a) GNU/Linux: lsof | grep velocity.log|wc -l 
>  b) Windows: handle | find "velocity.log"  (You can get handle.exe from 
> http://www.systeminternals.com)   Expected Result: velocity.log should be 
> opened one or a few times.  Actual Result: velocity.log is opened 900 times 
> (9 times per call to "init").

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to