Hello,

http://logging.apache.org/log4php/docs/appenders.html#LoggerAppenderDailyFile
there is some more which needs to be configured:

log4php.appender.default.datePattern = Ymd
log4php.appender.default.file = target/examples/daily_%s.log

In your case it should look like:

<appender name="logged_it" class='LoggerAppenderDailyFile'>
<layout class="LoggerLayoutTTCC" />
<param name="datePattern" value="Ymd" />
<param name="file" value="target/examples/daily_%s.log" />
 </appender>

Or similar

However, I just reckognized that the xml documentation is far from
good. Its no surprise its usage is unclear.

Best regards,
Christian


On Tue, Jan 4, 2011 at 3:24 AM, tinkee <lee.tinki.ti...@gmail.com> wrote:
>
> hi,
>
> i'm using the log4php for my logging.
> specifically the LoggerAppenderDailyFile
> but it could not create the logfile successfully.
>
>
> myconfig.xml -->resides in the same level with my php file
> --------------------------------------------------------------------
> log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"; >
>    <appender name="logged_it" class='LoggerAppenderDailyFile'>
>
>
>        <layout class="LoggerLayoutTTCC">
>
>
>
>
>        </layout>
>    </appender>
>    <root>
>        <level value="debug" />
>        <appender_ref ref="logged_it" />
>    </root>
> </log4php:configuration>
>
>
>
> the php file is this:
> <?php
>
> require_once ('../log4php/php/Logger.php');
> Logger::configure('myconfig.xml');
>
> //for checking
> $temp = "hello there!";
> echo $temp;
>
> $logger = Logger::getLogger('myLogger');   -->what should be specified here
> in getLogger?
>                                                          -->a random value
> is assigned here
> $logger->debug('Hello!');
>
> ?>
>
>
> did i miss out on somehting?
>
> my php version is php5.1.X
> and im using the log4php 2.0.0-incubating.
>
> does the version has any effect?
>
> thanks a lot.
> --
> View this message in context: 
> http://old.nabble.com/log4php-not-working-properly-tp30583406p30583406.html
> Sent from the Log4php - Users mailing list archive at Nabble.com.
>
>



-- 
http://www.grobmeier.de

Reply via email to