Petras created TOMEE-1856:
-----------------------------

             Summary: Empty log files from AsyncConsoleHandler
                 Key: TOMEE-1856
                 URL: https://issues.apache.org/jira/browse/TOMEE-1856
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 7.0.1
            Reporter: Petras
            Priority: Minor


{{org.apache.tomee.jul.formatter.AsyncConsoleHandler}} instantiation triggers 
creation of empty log files, prefixed with "juli." (ex. _juli.2016-07-02.log_) 
in _\{currentDir\}/logs/_, where _\{currentDir\}_ is folder from which TomEE 
was started. Please note, not in _$\{catalina.base}/logs_ folder. As this 
handler is meant for logging to the console, it is not supposed to create any 
log files, is it?

The issue is that this class indirectly extends 
{{org.apache.juli.FileHandler}}, which constructor invokes 
{{FileHandler#openWriter}} method creating log file for writing. If directory 
is not supplied via constructor parameters it creates _logs/_ folder within 
current folder and new file to for output log. The fix would be to override 
this method with empty body. 

The only workaround is to specify location of this empty file in TomEE 
_logging.properties_ ex.: 
{{org.apache.tomee.jul.formatter.AsyncConsoleHandler.directory = 
$\{catalina.base}/logs}}





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

Reply via email to