You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "igor nadj (JIRA)" <ji...@apache.org> on 2010/11/19 05:30:13 UTC

[jira] Created: (LOG4PHP-130) LoggerAppenderFile creates empty log files

LoggerAppenderFile creates empty log files
------------------------------------------

                 Key: LOG4PHP-130
                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
             Project: Log4php
          Issue Type: Bug
          Components: Code
    Affects Versions: 2.3
         Environment: -
            Reporter: igor nadj
            Priority: Minor
             Fix For: 2.0


My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.


My pseudo-patch submission: 

In LoggerAppenderFile.php

Change 
public function activateOptions(){ ... }

to a stub
public function activateOptions(){ }

moving the contents of activateOptions to a new function
protected function open(){
 if($this->fp) return;
 <code from activateOptions here>
}

where the new function is called at the start of append()
public function append(LoggerLoggingEvent $event) {
 if(!$this->fp) $this->open();
 <rest of function>
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Commented] (LOG4PHP-130) LoggerAppenderFile creates empty log files

Posted by "Juraj Zitniak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4PHP-130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400434#comment-13400434 ] 

Juraj Zitniak commented on LOG4PHP-130:
---------------------------------------

Hello,

we also need it in our project. We have many users visiting our site and each request opens empty file which it's time consuming and it slows our site. Currently we must modify sources of log4php so we could use it. Please could you implement this issue ?

Thank you

Juraj
                
> LoggerAppenderFile creates empty log files
> ------------------------------------------
>
>                 Key: LOG4PHP-130
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.0.0
>         Environment: -
>            Reporter: igor nadj
>            Priority: Minor
>
> My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.
> My pseudo-patch submission: 
> In LoggerAppenderFile.php
> Change 
> public function activateOptions(){ ... }
> to a stub
> public function activateOptions(){ }
> moving the contents of activateOptions to a new function
> protected function open(){
>  if($this->fp) return;
>  <code from activateOptions here>
> }
> where the new function is called at the start of append()
> public function append(LoggerLoggingEvent $event) {
>  if(!$this->fp) $this->open();
>  <rest of function>
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (LOG4PHP-130) LoggerAppenderFile creates empty log files

Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Grobmeier updated LOG4PHP-130:
----------------------------------------

    Fix Version/s:     (was: 2.1)
                   2.2

> LoggerAppenderFile creates empty log files
> ------------------------------------------
>
>                 Key: LOG4PHP-130
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.0
>         Environment: -
>            Reporter: igor nadj
>            Priority: Minor
>             Fix For: 2.2
>
>
> My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.
> My pseudo-patch submission: 
> In LoggerAppenderFile.php
> Change 
> public function activateOptions(){ ... }
> to a stub
> public function activateOptions(){ }
> moving the contents of activateOptions to a new function
> protected function open(){
>  if($this->fp) return;
>  <code from activateOptions here>
> }
> where the new function is called at the start of append()
> public function append(LoggerLoggingEvent $event) {
>  if(!$this->fp) $this->open();
>  <rest of function>
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (LOG4PHP-130) LoggerAppenderFile creates empty log files

Posted by "Ivan Habunek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4PHP-130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12933710#action_12933710 ] 

Ivan Habunek commented on LOG4PHP-130:
--------------------------------------

Actually this is something that has been bugging me as well, but I never got around to reporting/fixing it. I will have a look at the code. Your solution seems sound.

> LoggerAppenderFile creates empty log files
> ------------------------------------------
>
>                 Key: LOG4PHP-130
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.3
>         Environment: -
>            Reporter: igor nadj
>            Priority: Minor
>             Fix For: 2.0
>
>
> My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.
> My pseudo-patch submission: 
> In LoggerAppenderFile.php
> Change 
> public function activateOptions(){ ... }
> to a stub
> public function activateOptions(){ }
> moving the contents of activateOptions to a new function
> protected function open(){
>  if($this->fp) return;
>  <code from activateOptions here>
> }
> where the new function is called at the start of append()
> public function append(LoggerLoggingEvent $event) {
>  if(!$this->fp) $this->open();
>  <rest of function>
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LOG4PHP-130) LoggerAppenderFile creates empty log files

Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Grobmeier updated LOG4PHP-130:
----------------------------------------

    Affects Version/s:     (was: 2.3)
                       2.0
        Fix Version/s:     (was: 2.0)
                       2.1

> LoggerAppenderFile creates empty log files
> ------------------------------------------
>
>                 Key: LOG4PHP-130
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.0
>         Environment: -
>            Reporter: igor nadj
>            Priority: Minor
>             Fix For: 2.1
>
>
> My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.
> My pseudo-patch submission: 
> In LoggerAppenderFile.php
> Change 
> public function activateOptions(){ ... }
> to a stub
> public function activateOptions(){ }
> moving the contents of activateOptions to a new function
> protected function open(){
>  if($this->fp) return;
>  <code from activateOptions here>
> }
> where the new function is called at the start of append()
> public function append(LoggerLoggingEvent $event) {
>  if(!$this->fp) $this->open();
>  <rest of function>
> }

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (LOG4PHP-130) LoggerAppenderFile creates empty log files

Posted by "Ivan Habunek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek closed LOG4PHP-130.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.0
         Assignee: Ivan Habunek
    
> LoggerAppenderFile creates empty log files
> ------------------------------------------
>
>                 Key: LOG4PHP-130
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.0.0
>         Environment: -
>            Reporter: igor nadj
>            Assignee: Ivan Habunek
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.
> My pseudo-patch submission: 
> In LoggerAppenderFile.php
> Change 
> public function activateOptions(){ ... }
> to a stub
> public function activateOptions(){ }
> moving the contents of activateOptions to a new function
> protected function open(){
>  if($this->fp) return;
>  <code from activateOptions here>
> }
> where the new function is called at the start of append()
> public function append(LoggerLoggingEvent $event) {
>  if(!$this->fp) $this->open();
>  <rest of function>
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (LOG4PHP-130) LoggerAppenderFile creates empty log files

Posted by "Ivan Habunek (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4PHP-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Habunek updated LOG4PHP-130:
---------------------------------

    Fix Version/s:     (was: 2.2)

Not planned for 2.2.
                
> LoggerAppenderFile creates empty log files
> ------------------------------------------
>
>                 Key: LOG4PHP-130
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-130
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.0
>         Environment: -
>            Reporter: igor nadj
>            Priority: Minor
>
> My configuration uses LoggerAppenderDailyFile with a date pattern which includes seconds, the intent is to create a new log file for each error. The issue I've come across is that at each request it opens the file, then closes it (writing out the footer) without actually logging any error messages. My solution is to move the file-creation code to the time when the first log event is handled.
> My pseudo-patch submission: 
> In LoggerAppenderFile.php
> Change 
> public function activateOptions(){ ... }
> to a stub
> public function activateOptions(){ }
> moving the contents of activateOptions to a new function
> protected function open(){
>  if($this->fp) return;
>  <code from activateOptions here>
> }
> where the new function is called at the start of append()
> public function append(LoggerLoggingEvent $event) {
>  if(!$this->fp) $this->open();
>  <rest of function>
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira