Hi!

thanks a lot for the reply!
i've figured out the problem already, i think in the fopen part of
Logger.php
it could not create the file.

Because i tried to create an empty file with the same title as the filename
that i set in my xml,
it successfully wrote on the logfile! i read that fopen(), would supposedly
create an unexisting file
if "w" is specified in the second param. i tried it and i could not get it
to work.. if i dont create a file
in the path i specified, it could not create the file successfully.

have an idea how to do it? :(

thanks a lot.

 



Christian grobmeier wrote:
> 
> 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" />
> 
> 
>  </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
> 
> 

-- 
View this message in context: 
http://old.nabble.com/log4php-not-working-properly-tp30583406p30584450.html
Sent from the Log4php - Users mailing list archive at Nabble.com.

Reply via email to