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 Christian Grobmeier <gr...@gmail.com> on 2013/06/07 20:29:01 UTC
LoggerAppenderRollingFile confusion
Hi,
these docs:
http://logging.apache.org/log4php/docs/appenders/rolling-file.html
say, one must include a %s:
"Should contain a %s which gets substituted by the date."
I have tried that, but it seems I don't need to do that. From the code
I didn't see anything which would point into that direction. Anybody
knows anything about it? Otherwise i remove this refence.
Also I found out one needs to give a full path to the rolling file.
Like /var/www/xyz.log.
Otherwise filesize() would return with a warning. We could disable
that warning with @filesize, but i am not sure if that is a good idea.
Here is the warn:
Warning: filesize(): stat failed for log/cicada.log in
/var/www/cicada/vendor/apache/log4php/src/main/php/appenders/LoggerAppenderRollingFile.php
on line 223
The other option is to document a full path is needed.
Thoughts on that?
Cheers
Christian
Re: LoggerAppenderRollingFile confusion
Posted by Ivan Habunek <iv...@gmail.com>.
On 7 June 2013 20:29, Christian Grobmeier <gr...@gmail.com> wrote:
> Also I found out one needs to give a full path to the rolling file.
> Like /var/www/xyz.log.
> Otherwise filesize() would return with a warning. We could disable
> that warning with @filesize, but i am not sure if that is a good idea.
>
> Here is the warn:
>
> Warning: filesize(): stat failed for log/cicada.log in
>
> /var/www/cicada/vendor/apache/log4php/src/main/php/appenders/LoggerAppenderRollingFile.php
> on line 223
>
I'm unable to reproduce this issue. I don't get a warning. Here's my test
with a relative file path:
http://pastebin.com/4tE9mZ1d
Can you provide a code sample which produces the warning?
Regards,
Ivan
Re: LoggerAppenderRollingFile confusion
Posted by Ivan Habunek <iv...@gmail.com>.
On 7 June 2013 20:29, Christian Grobmeier <gr...@gmail.com> wrote:
> Hi,
>
> these docs:
> http://logging.apache.org/log4php/docs/appenders/rolling-file.html
>
> say, one must include a %s:
> "Should contain a %s which gets substituted by the date."
>
> I have tried that, but it seems I don't need to do that. From the code
> I didn't see anything which would point into that direction. Anybody
> knows anything about it? Otherwise i remove this refence.
>
You're right. It's a copy/paste leftover from the LoggerAppenderDailyFile.
Please delete it.
> Also I found out one needs to give a full path to the rolling file.
> Like /var/www/xyz.log.
> Otherwise filesize() would return with a warning. We could disable
> that warning with @filesize, but i am not sure if that is a good idea.
>
> Here is the warn:
>
> Warning: filesize(): stat failed for log/cicada.log in
>
> /var/www/cicada/vendor/apache/log4php/src/main/php/appenders/LoggerAppenderRollingFile.php
> on line 223
>
> The other option is to document a full path is needed.
>
I'll try it out and see what's up with that.
Regards,
Ivan