You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-user@logging.apache.org by Florian Platzer <Fl...@kfv.at> on 2010/03/03 13:44:10 UTC
Illogical logging by rootLogger
I created the following log4php configuration file and wondered, why a
$logger->debug('xyz')
on ldap-logger created an formatted log4php-output on the webpage:
return array(
'rootLogger' => array(
'level' => 'FATAL',
'appenders' => array('echo'),
),
'loggers' => array(
'ldap' => array(
'level' => 'DEBUG',
'appenders' => array('email'),
),
),
'appenders' => array(
'echo' => array(
'class' => 'LoggerAppenderEcho',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
),
'email' => array(
'class' =>
'LoggerAppenderMailEvent',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
'from' => 'from@mail.com',
'to' => 'to@mail.com',
'subject' => 'Error',
'smtpHost' => '0.0.0.0',
),
),
);
In my understanding, the rootLogger only should log in case of FATAL
errors!?
Florian
Re: Re: Re: Re: Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
ah well ok :-) I will try this tomorrow morning on my local setup -
maybe its just something we overlook right now. Lets hope so :-)
Thanks for trying
On Wed, Mar 3, 2010 at 3:25 PM, Florian Platzer <Fl...@kfv.at> wrote:
> Of course!
> First the bad news: It doesn't work :(
> Good news: No error occured and currently you don't have to spend time in
> writing testcases ;)
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 15:16
> Betreff:
> Re: Re: Re: Re: Illogical logging by rootLogger
>
>
>
> wow, I think I will need to reproduce your case.
> However... give it one last try, just as trial and error.
> Can you replace the layout class? We had some bugs on the
> PatternLayout lateley and maybe you are running into a very curious
> one. This one should work at least:
> <layout class="LoggerLayoutTTCC" />
>
> If not, I will try to reproduce your problem. Otherwise I'll start
> writing better testcases for the PatternLayouts :-(
>
> On Wed, Mar 3, 2010 at 3:01 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
>>
>> Yes, it should be so, but I'm afraid it isn't
>> If I switch the ldap-appender from "ldap" to "echo", then I get the same
>> result - nothing.
>>
>> Xml in general is absolutely no problem, but due to the documentation
> php
>> config was easier to understand/work with it.
>>
>>
>>
>> Von:
>> Christian Grobmeier <gr...@gmail.com>
>> An:
>> Log4PHP User <lo...@logging.apache.org>
>> Datum:
>> 03.03.2010 14:55
>> Betreff:
>> Re: Re: Re: Illogical logging by rootLogger
>>
>>
>>
>> Ok - so with your current setup you should see the 'Testlog" on echo
>> the dailyfile might be created when configuration of log4php happens -
>> would need a look into code to verify :-)
>> So besides you MailEvent Issue - is this now working better for you? Is
> it
>> a problem to use XML cnfiguration instead of ph configuration at the
>> moment?
>>
>>
>> On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
>> wrote:
>> Hi,
>>
>> the logger is instantiated this way:
>>
>> $_logger = Logger::getLogger('ldap');
>> $_logger->debug('Testlog');
>>
>> thanks, threshold-attr has been removed
>>
>> But I noticed, that the dailyfile.log will be created (without content),
>> so in any way the config seems to work ;)
>>
>> Florian
>>
>>
>>
>> Von:
>> Christian Grobmeier <gr...@gmail.com>
>> An:
>> Log4PHP User <lo...@logging.apache.org>
>> Datum:
>> 03.03.2010 14:42
>> Betreff:
>> Re: Re: Illogical logging by rootLogger
>>
>>
>>
>> Hi,
>> how do you instantiate your logger object?
>>
>> I mean code like:
>> $logger = Logger::getLogger("b");
>>
>> for the ldap
>>
>> And I think you need to remove threshold="ALL" in the first tag, because
>> it will filter out everything
>>
>> Christian
>>
>> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
>> wrote:
>> Hi,
>>
>> thanks for your response!
>> I've now tried to use a xml configuration file and had a look in the
>> xml/log4php.dtd
>>
>> Thats the result:
>>
>> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/
> "
>> threshold="ALL">
>> <root>
>> <level value="FATAL" />
>> <appender_ref ref="echo" />
>> </root>
>>
>> <logger name="ldap">
>> <level value="DEBUG" />
>> <appender_ref ref="echo" />
>> </logger>
>>
>> <logger name="mssql">
>> <level value="DEBUG" />
>> <appender_ref ref="dailyfile" />
>> </logger>
>>
>> <logger name="mysql">
>> <level value="DEBUG" />
>> <appender_ref ref="dailyfile" />
>> </logger>
>>
>> <appender name="dailyfile" class="LoggerAppenderDailyFile">
>> <param name="append" value="true" />
>> <param name="datePattern" value="Ymd" />
>> <param name="file" value="xyz.log" />
>> <layout class="LoggerLayoutPattern">
>> <param name="conversionPattern" value="%d{H:i:s}
>> %-5p %c %X{username}: %m in %F at %L%n" />
>> </layout>
>> </appender>
>>
>> <appender name="echo" class="LoggerAppenderEcho">
>> <layout class="LoggerLayoutPattern">
>> <param name="conversionPattern" value="%d{Y-m-d
>> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
>> </layout>
>> </appender>
>>
>> <appender name="email" class="LoggerAppenderMailEvent">
>> <param name="from" value="mail@kfv.at" />
>> <param name="to" value="mail@kfv.at" />
>> <param name="subject" value="Error" />
>> <param name="smtpHost" value="0.0.0.0" />
>> <layout class="LoggerLayoutPattern">
>> <param name="conversionPattern" value="%d{Y-m-d
>> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
>> </layout>
>> </appender>
>>
>> </log4php:configuration>
>>
>>
>> But now there is nothing logged any more, so I think that any tags are
> not
>> configured properly...
>> Could you please check this?
>>
>> Florian
>>
>>
>>
>> Von:
>> Christian Grobmeier <gr...@gmail.com>
>> An:
>> Log4PHP User <lo...@logging.apache.org>
>> Datum:
>> 03.03.2010 13:51
>> Betreff:
>> Re: Illogical logging by rootLogger
>>
>>
>>
>> Hi,
>>
>> at first glance, I would think the same. I will need to try it out.
>> However - please have in mind that the php configuration is still
>> experimental. Maybe you are running into a bug here. Did you try the old
>> fashioned way with xml or property file?
>>
>> Christian
>>
>> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
>> wrote:
>> I created the following log4php configuration file and wondered, why a
>>
>> $logger->debug('xyz')
>>
>> on ldap-logger created an formatted log4php-output on the webpage:
>>
>> return array(
>> 'rootLogger' => array(
>> 'level' => 'FATAL',
>> 'appenders' => array('echo'),
>> ),
>> 'loggers' => array(
>> 'ldap' => array(
>> 'level' => 'DEBUG',
>> 'appenders' => array('email'),
>> ),
>> ),
>> 'appenders' => array(
>> 'echo' => array(
>> 'class' => 'LoggerAppenderEcho',
>> 'layout' => array(
>> 'class' =>
>> 'LoggerLayoutPattern',
>> 'conversionPattern' =>
>> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
>> ),
>> ),
>> 'email' => array(
>> 'class' =>
>> 'LoggerAppenderMailEvent',
>> 'layout' => array(
>> 'class' =>
>> 'LoggerLayoutPattern',
>> 'conversionPattern' =>
>> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
>> ),
>> 'from' => 'from@mail.com',
>> 'to' => 'to@mail.com',
>> 'subject' => 'Error',
>> 'smtpHost' => '0.0.0.0',
>> ),
>> ),
>> );
>>
>>
>> In my understanding, the rootLogger only should log in case of FATAL
>> errors!?
>>
>> Florian
>>
>>
>>
>>
>>
>>
>>
>
>
>
Antwort: Re: Re: Re: Re: Illogical logging by rootLogger
Posted by Florian Platzer <Fl...@kfv.at>.
Of course!
First the bad news: It doesn't work :(
Good news: No error occured and currently you don't have to spend time in
writing testcases ;)
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 15:16
Betreff:
Re: Re: Re: Re: Illogical logging by rootLogger
wow, I think I will need to reproduce your case.
However... give it one last try, just as trial and error.
Can you replace the layout class? We had some bugs on the
PatternLayout lateley and maybe you are running into a very curious
one. This one should work at least:
<layout class="LoggerLayoutTTCC" />
If not, I will try to reproduce your problem. Otherwise I'll start
writing better testcases for the PatternLayouts :-(
On Wed, Mar 3, 2010 at 3:01 PM, Florian Platzer <Fl...@kfv.at>
wrote:
>
> Yes, it should be so, but I'm afraid it isn't
> If I switch the ldap-appender from "ldap" to "echo", then I get the same
> result - nothing.
>
> Xml in general is absolutely no problem, but due to the documentation
php
> config was easier to understand/work with it.
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:55
> Betreff:
> Re: Re: Re: Illogical logging by rootLogger
>
>
>
> Ok - so with your current setup you should see the 'Testlog" on echo
> the dailyfile might be created when configuration of log4php happens -
> would need a look into code to verify :-)
> So besides you MailEvent Issue - is this now working better for you? Is
it
> a problem to use XML cnfiguration instead of ph configuration at the
> moment?
>
>
> On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> the logger is instantiated this way:
>
> $_logger = Logger::getLogger('ldap');
> $_logger->debug('Testlog');
>
> thanks, threshold-attr has been removed
>
> But I noticed, that the dailyfile.log will be created (without content),
> so in any way the config seems to work ;)
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:42
> Betreff:
> Re: Re: Illogical logging by rootLogger
>
>
>
> Hi,
> how do you instantiate your logger object?
>
> I mean code like:
> $logger = Logger::getLogger("b");
>
> for the ldap
>
> And I think you need to remove threshold="ALL" in the first tag, because
> it will filter out everything
>
> Christian
>
> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> thanks for your response!
> I've now tried to use a xml configuration file and had a look in the
> xml/log4php.dtd
>
> Thats the result:
>
> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/
"
> threshold="ALL">
> <root>
> <level value="FATAL" />
> <appender_ref ref="echo" />
> </root>
>
> <logger name="ldap">
> <level value="DEBUG" />
> <appender_ref ref="echo" />
> </logger>
>
> <logger name="mssql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <logger name="mysql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <appender name="dailyfile" class="LoggerAppenderDailyFile">
> <param name="append" value="true" />
> <param name="datePattern" value="Ymd" />
> <param name="file" value="xyz.log" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{H:i:s}
> %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="echo" class="LoggerAppenderEcho">
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="email" class="LoggerAppenderMailEvent">
> <param name="from" value="mail@kfv.at" />
> <param name="to" value="mail@kfv.at" />
> <param name="subject" value="Error" />
> <param name="smtpHost" value="0.0.0.0" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> </log4php:configuration>
>
>
> But now there is nothing logged any more, so I think that any tags are
not
> configured properly...
> Could you please check this?
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 13:51
> Betreff:
> Re: Illogical logging by rootLogger
>
>
>
> Hi,
>
> at first glance, I would think the same. I will need to try it out.
> However - please have in mind that the php configuration is still
> experimental. Maybe you are running into a bug here. Did you try the old
> fashioned way with xml or property file?
>
> Christian
>
> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>
>
>
>
>
>
Re: Re: Re: Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
wow, I think I will need to reproduce your case.
However... give it one last try, just as trial and error.
Can you replace the layout class? We had some bugs on the
PatternLayout lateley and maybe you are running into a very curious
one. This one should work at least:
<layout class="LoggerLayoutTTCC" />
If not, I will try to reproduce your problem. Otherwise I'll start
writing better testcases for the PatternLayouts :-(
On Wed, Mar 3, 2010 at 3:01 PM, Florian Platzer <Fl...@kfv.at> wrote:
>
> Yes, it should be so, but I'm afraid it isn't
> If I switch the ldap-appender from "ldap" to "echo", then I get the same
> result - nothing.
>
> Xml in general is absolutely no problem, but due to the documentation php
> config was easier to understand/work with it.
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:55
> Betreff:
> Re: Re: Re: Illogical logging by rootLogger
>
>
>
> Ok - so with your current setup you should see the 'Testlog" on echo
> the dailyfile might be created when configuration of log4php happens -
> would need a look into code to verify :-)
> So besides you MailEvent Issue - is this now working better for you? Is it
> a problem to use XML cnfiguration instead of ph configuration at the
> moment?
>
>
> On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> the logger is instantiated this way:
>
> $_logger = Logger::getLogger('ldap');
> $_logger->debug('Testlog');
>
> thanks, threshold-attr has been removed
>
> But I noticed, that the dailyfile.log will be created (without content),
> so in any way the config seems to work ;)
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:42
> Betreff:
> Re: Re: Illogical logging by rootLogger
>
>
>
> Hi,
> how do you instantiate your logger object?
>
> I mean code like:
> $logger = Logger::getLogger("b");
>
> for the ldap
>
> And I think you need to remove threshold="ALL" in the first tag, because
> it will filter out everything
>
> Christian
>
> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> thanks for your response!
> I've now tried to use a xml configuration file and had a look in the
> xml/log4php.dtd
>
> Thats the result:
>
> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
> threshold="ALL">
> <root>
> <level value="FATAL" />
> <appender_ref ref="echo" />
> </root>
>
> <logger name="ldap">
> <level value="DEBUG" />
> <appender_ref ref="echo" />
> </logger>
>
> <logger name="mssql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <logger name="mysql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <appender name="dailyfile" class="LoggerAppenderDailyFile">
> <param name="append" value="true" />
> <param name="datePattern" value="Ymd" />
> <param name="file" value="xyz.log" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{H:i:s}
> %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="echo" class="LoggerAppenderEcho">
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="email" class="LoggerAppenderMailEvent">
> <param name="from" value="mail@kfv.at" />
> <param name="to" value="mail@kfv.at" />
> <param name="subject" value="Error" />
> <param name="smtpHost" value="0.0.0.0" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> </log4php:configuration>
>
>
> But now there is nothing logged any more, so I think that any tags are not
> configured properly...
> Could you please check this?
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 13:51
> Betreff:
> Re: Illogical logging by rootLogger
>
>
>
> Hi,
>
> at first glance, I would think the same. I will need to try it out.
> However - please have in mind that the php configuration is still
> experimental. Maybe you are running into a bug here. Did you try the old
> fashioned way with xml or property file?
>
> Christian
>
> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>
>
>
>
>
>
Re: Re: Re: Re: Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
Hi,
> By the way which setting is necessary to get a html-line-break in
> LoggerAppenderEcho output?
> Currently only an ANSI line break is appended to a line.
currently thats not possible. One (maybe you? ;-)) needs to add a new
option to the AppenderEcho like "addHTMLLineBreak" or something
You could create a new Jira Feature issue on that. If you like, you
can also add a patch to this issue and I will review and apply it
Cheers
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 04.03.2010 09:29
> Betreff:
> Re: Re: Re: Re: Illogical logging by rootLogger
>
>
>
> Florian, i have found the solution. Its a bit weird. However, please
> configure the appender FIRST, and then the Loggers.
> I think this is worth a fix.
>
> Let me know if that helps you
> Christian
>
> On Wed, Mar 3, 2010 at 3:01 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
>> Yes, it should be so, but I'm afraid it isn't
>> If I switch the ldap-appender from "ldap" to "echo", then I get the same
>> result - nothing.
>>
>> Xml in general is absolutely no problem, but due to the documentation
> php
>> config was easier to understand/work with it.
>>
>>
>>
>> Von:
>> Christian Grobmeier <gr...@gmail.com>
>> An:
>> Log4PHP User <lo...@logging.apache.org>
>> Datum:
>> 03.03.2010 14:55
>> Betreff:
>> Re: Re: Re: Illogical logging by rootLogger
>>
>>
>>
>> Ok - so with your current setup you should see the 'Testlog" on echo
>> the dailyfile might be created when configuration of log4php happens -
>> would need a look into code to verify :-)
>> So besides you MailEvent Issue - is this now working better for you? Is
> it
>> a problem to use XML cnfiguration instead of ph configuration at the
>> moment?
>>
>>
>> On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
>> wrote:
>> Hi,
>>
>> the logger is instantiated this way:
>>
>> $_logger = Logger::getLogger('ldap');
>> $_logger->debug('Testlog');
>>
>> thanks, threshold-attr has been removed
>>
>> But I noticed, that the dailyfile.log will be created (without content),
>> so in any way the config seems to work ;)
>>
>> Florian
>>
>>
>>
>> Von:
>> Christian Grobmeier <gr...@gmail.com>
>> An:
>> Log4PHP User <lo...@logging.apache.org>
>> Datum:
>> 03.03.2010 14:42
>> Betreff:
>> Re: Re: Illogical logging by rootLogger
>>
>>
>>
>> Hi,
>> how do you instantiate your logger object?
>>
>> I mean code like:
>> $logger = Logger::getLogger("b");
>>
>> for the ldap
>>
>> And I think you need to remove threshold="ALL" in the first tag, because
>> it will filter out everything
>>
>> Christian
>>
>> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
>> wrote:
>> Hi,
>>
>> thanks for your response!
>> I've now tried to use a xml configuration file and had a look in the
>> xml/log4php.dtd
>>
>> Thats the result:
>>
>> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/
> "
>> threshold="ALL">
>> <root>
>> <level value="FATAL" />
>> <appender_ref ref="echo" />
>> </root>
>>
>> <logger name="ldap">
>> <level value="DEBUG" />
>> <appender_ref ref="echo" />
>> </logger>
>>
>> <logger name="mssql">
>> <level value="DEBUG" />
>> <appender_ref ref="dailyfile" />
>> </logger>
>>
>> <logger name="mysql">
>> <level value="DEBUG" />
>> <appender_ref ref="dailyfile" />
>> </logger>
>>
>> <appender name="dailyfile" class="LoggerAppenderDailyFile">
>> <param name="append" value="true" />
>> <param name="datePattern" value="Ymd" />
>> <param name="file" value="xyz.log" />
>> <layout class="LoggerLayoutPattern">
>> <param name="conversionPattern" value="%d{H:i:s}
>> %-5p %c %X{username}: %m in %F at %L%n" />
>> </layout>
>> </appender>
>>
>> <appender name="echo" class="LoggerAppenderEcho">
>> <layout class="LoggerLayoutPattern">
>> <param name="conversionPattern" value="%d{Y-m-d
>> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
>> </layout>
>> </appender>
>>
>> <appender name="email" class="LoggerAppenderMailEvent">
>> <param name="from" value="mail@kfv.at" />
>> <param name="to" value="mail@kfv.at" />
>> <param name="subject" value="Error" />
>> <param name="smtpHost" value="0.0.0.0" />
>> <layout class="LoggerLayoutPattern">
>> <param name="conversionPattern" value="%d{Y-m-d
>> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
>> </layout>
>> </appender>
>>
>> </log4php:configuration>
>>
>>
>> But now there is nothing logged any more, so I think that any tags are
> not
>> configured properly...
>> Could you please check this?
>>
>> Florian
>>
>>
>>
>> Von:
>> Christian Grobmeier <gr...@gmail.com>
>> An:
>> Log4PHP User <lo...@logging.apache.org>
>> Datum:
>> 03.03.2010 13:51
>> Betreff:
>> Re: Illogical logging by rootLogger
>>
>>
>>
>> Hi,
>>
>> at first glance, I would think the same. I will need to try it out.
>> However - please have in mind that the php configuration is still
>> experimental. Maybe you are running into a bug here. Did you try the old
>> fashioned way with xml or property file?
>>
>> Christian
>>
>> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
>> wrote:
>> I created the following log4php configuration file and wondered, why a
>>
>> $logger->debug('xyz')
>>
>> on ldap-logger created an formatted log4php-output on the webpage:
>>
>> return array(
>> 'rootLogger' => array(
>> 'level' => 'FATAL',
>> 'appenders' => array('echo'),
>> ),
>> 'loggers' => array(
>> 'ldap' => array(
>> 'level' => 'DEBUG',
>> 'appenders' => array('email'),
>> ),
>> ),
>> 'appenders' => array(
>> 'echo' => array(
>> 'class' => 'LoggerAppenderEcho',
>> 'layout' => array(
>> 'class' =>
>> 'LoggerLayoutPattern',
>> 'conversionPattern' =>
>> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
>> ),
>> ),
>> 'email' => array(
>> 'class' =>
>> 'LoggerAppenderMailEvent',
>> 'layout' => array(
>> 'class' =>
>> 'LoggerLayoutPattern',
>> 'conversionPattern' =>
>> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
>> ),
>> 'from' => 'from@mail.com',
>> 'to' => 'to@mail.com',
>> 'subject' => 'Error',
>> 'smtpHost' => '0.0.0.0',
>> ),
>> ),
>> );
>>
>>
>> In my understanding, the rootLogger only should log in case of FATAL
>> errors!?
>>
>> Florian
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
Antwort: Re: Re: Re: Re: Illogical logging by rootLogger
Posted by Florian Platzer <Fl...@kfv.at>.
Hi Christian,
yeah, it works now.
Thanks a lot!
By the way which setting is necessary to get a html-line-break in
LoggerAppenderEcho output?
Currently only an ANSI line break is appended to a line.
Florian
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
04.03.2010 09:29
Betreff:
Re: Re: Re: Re: Illogical logging by rootLogger
Florian, i have found the solution. Its a bit weird. However, please
configure the appender FIRST, and then the Loggers.
I think this is worth a fix.
Let me know if that helps you
Christian
On Wed, Mar 3, 2010 at 3:01 PM, Florian Platzer <Fl...@kfv.at>
wrote:
> Yes, it should be so, but I'm afraid it isn't
> If I switch the ldap-appender from "ldap" to "echo", then I get the same
> result - nothing.
>
> Xml in general is absolutely no problem, but due to the documentation
php
> config was easier to understand/work with it.
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:55
> Betreff:
> Re: Re: Re: Illogical logging by rootLogger
>
>
>
> Ok - so with your current setup you should see the 'Testlog" on echo
> the dailyfile might be created when configuration of log4php happens -
> would need a look into code to verify :-)
> So besides you MailEvent Issue - is this now working better for you? Is
it
> a problem to use XML cnfiguration instead of ph configuration at the
> moment?
>
>
> On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> the logger is instantiated this way:
>
> $_logger = Logger::getLogger('ldap');
> $_logger->debug('Testlog');
>
> thanks, threshold-attr has been removed
>
> But I noticed, that the dailyfile.log will be created (without content),
> so in any way the config seems to work ;)
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:42
> Betreff:
> Re: Re: Illogical logging by rootLogger
>
>
>
> Hi,
> how do you instantiate your logger object?
>
> I mean code like:
> $logger = Logger::getLogger("b");
>
> for the ldap
>
> And I think you need to remove threshold="ALL" in the first tag, because
> it will filter out everything
>
> Christian
>
> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> thanks for your response!
> I've now tried to use a xml configuration file and had a look in the
> xml/log4php.dtd
>
> Thats the result:
>
> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/
"
> threshold="ALL">
> <root>
> <level value="FATAL" />
> <appender_ref ref="echo" />
> </root>
>
> <logger name="ldap">
> <level value="DEBUG" />
> <appender_ref ref="echo" />
> </logger>
>
> <logger name="mssql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <logger name="mysql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <appender name="dailyfile" class="LoggerAppenderDailyFile">
> <param name="append" value="true" />
> <param name="datePattern" value="Ymd" />
> <param name="file" value="xyz.log" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{H:i:s}
> %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="echo" class="LoggerAppenderEcho">
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="email" class="LoggerAppenderMailEvent">
> <param name="from" value="mail@kfv.at" />
> <param name="to" value="mail@kfv.at" />
> <param name="subject" value="Error" />
> <param name="smtpHost" value="0.0.0.0" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> </log4php:configuration>
>
>
> But now there is nothing logged any more, so I think that any tags are
not
> configured properly...
> Could you please check this?
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 13:51
> Betreff:
> Re: Illogical logging by rootLogger
>
>
>
> Hi,
>
> at first glance, I would think the same. I will need to try it out.
> However - please have in mind that the php configuration is still
> experimental. Maybe you are running into a bug here. Did you try the old
> fashioned way with xml or property file?
>
> Christian
>
> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>
>
>
>
>
>
>
Re: Re: Re: Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
Florian, i have found the solution. Its a bit weird. However, please
configure the appender FIRST, and then the Loggers.
I think this is worth a fix.
Let me know if that helps you
Christian
On Wed, Mar 3, 2010 at 3:01 PM, Florian Platzer <Fl...@kfv.at> wrote:
> Yes, it should be so, but I'm afraid it isn't
> If I switch the ldap-appender from "ldap" to "echo", then I get the same
> result - nothing.
>
> Xml in general is absolutely no problem, but due to the documentation php
> config was easier to understand/work with it.
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:55
> Betreff:
> Re: Re: Re: Illogical logging by rootLogger
>
>
>
> Ok - so with your current setup you should see the 'Testlog" on echo
> the dailyfile might be created when configuration of log4php happens -
> would need a look into code to verify :-)
> So besides you MailEvent Issue - is this now working better for you? Is it
> a problem to use XML cnfiguration instead of ph configuration at the
> moment?
>
>
> On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> the logger is instantiated this way:
>
> $_logger = Logger::getLogger('ldap');
> $_logger->debug('Testlog');
>
> thanks, threshold-attr has been removed
>
> But I noticed, that the dailyfile.log will be created (without content),
> so in any way the config seems to work ;)
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:42
> Betreff:
> Re: Re: Illogical logging by rootLogger
>
>
>
> Hi,
> how do you instantiate your logger object?
>
> I mean code like:
> $logger = Logger::getLogger("b");
>
> for the ldap
>
> And I think you need to remove threshold="ALL" in the first tag, because
> it will filter out everything
>
> Christian
>
> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> thanks for your response!
> I've now tried to use a xml configuration file and had a look in the
> xml/log4php.dtd
>
> Thats the result:
>
> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
> threshold="ALL">
> <root>
> <level value="FATAL" />
> <appender_ref ref="echo" />
> </root>
>
> <logger name="ldap">
> <level value="DEBUG" />
> <appender_ref ref="echo" />
> </logger>
>
> <logger name="mssql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <logger name="mysql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <appender name="dailyfile" class="LoggerAppenderDailyFile">
> <param name="append" value="true" />
> <param name="datePattern" value="Ymd" />
> <param name="file" value="xyz.log" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{H:i:s}
> %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="echo" class="LoggerAppenderEcho">
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="email" class="LoggerAppenderMailEvent">
> <param name="from" value="mail@kfv.at" />
> <param name="to" value="mail@kfv.at" />
> <param name="subject" value="Error" />
> <param name="smtpHost" value="0.0.0.0" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> </log4php:configuration>
>
>
> But now there is nothing logged any more, so I think that any tags are not
> configured properly...
> Could you please check this?
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 13:51
> Betreff:
> Re: Illogical logging by rootLogger
>
>
>
> Hi,
>
> at first glance, I would think the same. I will need to try it out.
> However - please have in mind that the php configuration is still
> experimental. Maybe you are running into a bug here. Did you try the old
> fashioned way with xml or property file?
>
> Christian
>
> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>
>
>
>
>
>
>
Antwort: Re: Re: Re: Illogical logging by rootLogger
Posted by Florian Platzer <Fl...@kfv.at>.
Yes, it should be so, but I'm afraid it isn't
If I switch the ldap-appender from "ldap" to "echo", then I get the same
result - nothing.
Xml in general is absolutely no problem, but due to the documentation php
config was easier to understand/work with it.
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 14:55
Betreff:
Re: Re: Re: Illogical logging by rootLogger
Ok - so with your current setup you should see the 'Testlog" on echo
the dailyfile might be created when configuration of log4php happens -
would need a look into code to verify :-)
So besides you MailEvent Issue - is this now working better for you? Is it
a problem to use XML cnfiguration instead of ph configuration at the
moment?
On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>
wrote:
Hi,
the logger is instantiated this way:
$_logger = Logger::getLogger('ldap');
$_logger->debug('Testlog');
thanks, threshold-attr has been removed
But I noticed, that the dailyfile.log will be created (without content),
so in any way the config seems to work ;)
Florian
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 14:42
Betreff:
Re: Re: Illogical logging by rootLogger
Hi,
how do you instantiate your logger object?
I mean code like:
$logger = Logger::getLogger("b");
for the ldap
And I think you need to remove threshold="ALL" in the first tag, because
it will filter out everything
Christian
On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
wrote:
Hi,
thanks for your response!
I've now tried to use a xml configuration file and had a look in the
xml/log4php.dtd
Thats the result:
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="ALL">
<root>
<level value="FATAL" />
<appender_ref ref="echo" />
</root>
<logger name="ldap">
<level value="DEBUG" />
<appender_ref ref="echo" />
</logger>
<logger name="mssql">
<level value="DEBUG" />
<appender_ref ref="dailyfile" />
</logger>
<logger name="mysql">
<level value="DEBUG" />
<appender_ref ref="dailyfile" />
</logger>
<appender name="dailyfile" class="LoggerAppenderDailyFile">
<param name="append" value="true" />
<param name="datePattern" value="Ymd" />
<param name="file" value="xyz.log" />
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{H:i:s}
%-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
<appender name="echo" class="LoggerAppenderEcho">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d
H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
<appender name="email" class="LoggerAppenderMailEvent">
<param name="from" value="mail@kfv.at" />
<param name="to" value="mail@kfv.at" />
<param name="subject" value="Error" />
<param name="smtpHost" value="0.0.0.0" />
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d
H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
</log4php:configuration>
But now there is nothing logged any more, so I think that any tags are not
configured properly...
Could you please check this?
Florian
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 13:51
Betreff:
Re: Illogical logging by rootLogger
Hi,
at first glance, I would think the same. I will need to try it out.
However - please have in mind that the php configuration is still
experimental. Maybe you are running into a bug here. Did you try the old
fashioned way with xml or property file?
Christian
On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
wrote:
I created the following log4php configuration file and wondered, why a
$logger->debug('xyz')
on ldap-logger created an formatted log4php-output on the webpage:
return array(
'rootLogger' => array(
'level' => 'FATAL',
'appenders' => array('echo'),
),
'loggers' => array(
'ldap' => array(
'level' => 'DEBUG',
'appenders' => array('email'),
),
),
'appenders' => array(
'echo' => array(
'class' => 'LoggerAppenderEcho',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
),
'email' => array(
'class' =>
'LoggerAppenderMailEvent',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
'from' => 'from@mail.com',
'to' => 'to@mail.com',
'subject' => 'Error',
'smtpHost' => '0.0.0.0',
),
),
);
In my understanding, the rootLogger only should log in case of FATAL
errors!?
Florian
Re: Re: Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
Ok - so with your current setup you should see the 'Testlog" on echo
the dailyfile might be created when configuration of log4php happens - would
need a look into code to verify :-)
So besides you MailEvent Issue - is this now working better for you? Is it a
problem to use XML cnfiguration instead of ph configuration at the moment?
On Wed, Mar 3, 2010 at 2:50 PM, Florian Platzer <Fl...@kfv.at>wrote:
> Hi,
>
> the logger is instantiated this way:
>
> $_logger = Logger::getLogger('ldap');
> $_logger->debug('Testlog');
>
> thanks, threshold-attr has been removed
>
> But I noticed, that the dailyfile.log will be created (without content),
> so in any way the config seems to work ;)
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 14:42
> Betreff:
> Re: Re: Illogical logging by rootLogger
>
>
>
> Hi,
> how do you instantiate your logger object?
>
> I mean code like:
> $logger = Logger::getLogger("b");
>
> for the ldap
>
> And I think you need to remove threshold="ALL" in the first tag, because
> it will filter out everything
>
> Christian
>
> On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> Hi,
>
> thanks for your response!
> I've now tried to use a xml configuration file and had a look in the
> xml/log4php.dtd
>
> Thats the result:
>
> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
> threshold="ALL">
> <root>
> <level value="FATAL" />
> <appender_ref ref="echo" />
> </root>
>
> <logger name="ldap">
> <level value="DEBUG" />
> <appender_ref ref="echo" />
> </logger>
>
> <logger name="mssql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <logger name="mysql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <appender name="dailyfile" class="LoggerAppenderDailyFile">
> <param name="append" value="true" />
> <param name="datePattern" value="Ymd" />
> <param name="file" value="xyz.log" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{H:i:s}
> %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="echo" class="LoggerAppenderEcho">
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="email" class="LoggerAppenderMailEvent">
> <param name="from" value="mail@kfv.at" />
> <param name="to" value="mail@kfv.at" />
> <param name="subject" value="Error" />
> <param name="smtpHost" value="0.0.0.0" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> </log4php:configuration>
>
>
> But now there is nothing logged any more, so I think that any tags are not
> configured properly...
> Could you please check this?
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 13:51
> Betreff:
> Re: Illogical logging by rootLogger
>
>
>
> Hi,
>
> at first glance, I would think the same. I will need to try it out.
> However - please have in mind that the php configuration is still
> experimental. Maybe you are running into a bug here. Did you try the old
> fashioned way with xml or property file?
>
> Christian
>
> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>
>
>
>
>
Antwort: Re: Re: Illogical logging by rootLogger
Posted by Florian Platzer <Fl...@kfv.at>.
Hi,
the logger is instantiated this way:
$_logger = Logger::getLogger('ldap');
$_logger->debug('Testlog');
thanks, threshold-attr has been removed
But I noticed, that the dailyfile.log will be created (without content),
so in any way the config seems to work ;)
Florian
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 14:42
Betreff:
Re: Re: Illogical logging by rootLogger
Hi,
how do you instantiate your logger object?
I mean code like:
$logger = Logger::getLogger("b");
for the ldap
And I think you need to remove threshold="ALL" in the first tag, because
it will filter out everything
Christian
On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>
wrote:
Hi,
thanks for your response!
I've now tried to use a xml configuration file and had a look in the
xml/log4php.dtd
Thats the result:
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="ALL">
<root>
<level value="FATAL" />
<appender_ref ref="echo" />
</root>
<logger name="ldap">
<level value="DEBUG" />
<appender_ref ref="echo" />
</logger>
<logger name="mssql">
<level value="DEBUG" />
<appender_ref ref="dailyfile" />
</logger>
<logger name="mysql">
<level value="DEBUG" />
<appender_ref ref="dailyfile" />
</logger>
<appender name="dailyfile" class="LoggerAppenderDailyFile">
<param name="append" value="true" />
<param name="datePattern" value="Ymd" />
<param name="file" value="xyz.log" />
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{H:i:s}
%-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
<appender name="echo" class="LoggerAppenderEcho">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d
H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
<appender name="email" class="LoggerAppenderMailEvent">
<param name="from" value="mail@kfv.at" />
<param name="to" value="mail@kfv.at" />
<param name="subject" value="Error" />
<param name="smtpHost" value="0.0.0.0" />
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d
H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
</log4php:configuration>
But now there is nothing logged any more, so I think that any tags are not
configured properly...
Could you please check this?
Florian
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 13:51
Betreff:
Re: Illogical logging by rootLogger
Hi,
at first glance, I would think the same. I will need to try it out.
However - please have in mind that the php configuration is still
experimental. Maybe you are running into a bug here. Did you try the old
fashioned way with xml or property file?
Christian
On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
wrote:
I created the following log4php configuration file and wondered, why a
$logger->debug('xyz')
on ldap-logger created an formatted log4php-output on the webpage:
return array(
'rootLogger' => array(
'level' => 'FATAL',
'appenders' => array('echo'),
),
'loggers' => array(
'ldap' => array(
'level' => 'DEBUG',
'appenders' => array('email'),
),
),
'appenders' => array(
'echo' => array(
'class' => 'LoggerAppenderEcho',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
),
'email' => array(
'class' =>
'LoggerAppenderMailEvent',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
'from' => 'from@mail.com',
'to' => 'to@mail.com',
'subject' => 'Error',
'smtpHost' => '0.0.0.0',
),
),
);
In my understanding, the rootLogger only should log in case of FATAL
errors!?
Florian
Re: Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
Hi,
how do you instantiate your logger object?
I mean code like:
$logger = Logger::getLogger("b");
for the ldap
And I think you need to remove threshold="ALL" in the first tag, because it
will filter out everything
Christian
On Wed, Mar 3, 2010 at 2:35 PM, Florian Platzer <Fl...@kfv.at>wrote:
> Hi,
>
> thanks for your response!
> I've now tried to use a xml configuration file and had a look in the
> xml/log4php.dtd
>
> Thats the result:
>
> <log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
> threshold="ALL">
> <root>
> <level value="FATAL" />
> <appender_ref ref="echo" />
> </root>
>
> <logger name="ldap">
> <level value="DEBUG" />
> <appender_ref ref="echo" />
> </logger>
>
> <logger name="mssql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <logger name="mysql">
> <level value="DEBUG" />
> <appender_ref ref="dailyfile" />
> </logger>
>
> <appender name="dailyfile" class="LoggerAppenderDailyFile">
> <param name="append" value="true" />
> <param name="datePattern" value="Ymd" />
> <param name="file" value="xyz.log" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{H:i:s}
> %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="echo" class="LoggerAppenderEcho">
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> <appender name="email" class="LoggerAppenderMailEvent">
> <param name="from" value="mail@kfv.at" />
> <param name="to" value="mail@kfv.at" />
> <param name="subject" value="Error" />
> <param name="smtpHost" value="0.0.0.0" />
> <layout class="LoggerLayoutPattern">
> <param name="conversionPattern" value="%d{Y-m-d
> H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
> </layout>
> </appender>
>
> </log4php:configuration>
>
>
> But now there is nothing logged any more, so I think that any tags are not
> configured properly...
> Could you please check this?
>
> Florian
>
>
>
> Von:
> Christian Grobmeier <gr...@gmail.com>
> An:
> Log4PHP User <lo...@logging.apache.org>
> Datum:
> 03.03.2010 13:51
> Betreff:
> Re: Illogical logging by rootLogger
>
>
>
> Hi,
>
> at first glance, I would think the same. I will need to try it out.
> However - please have in mind that the php configuration is still
> experimental. Maybe you are running into a bug here. Did you try the old
> fashioned way with xml or property file?
>
> Christian
>
> On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
> wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>
>
>
Antwort: Re: Illogical logging by rootLogger
Posted by Florian Platzer <Fl...@kfv.at>.
Hi,
thanks for your response!
I've now tried to use a xml configuration file and had a look in the
xml/log4php.dtd
Thats the result:
<log4php:configuration xmlns:log4php="http://logging.apache.org/log4php/"
threshold="ALL">
<root>
<level value="FATAL" />
<appender_ref ref="echo" />
</root>
<logger name="ldap">
<level value="DEBUG" />
<appender_ref ref="echo" />
</logger>
<logger name="mssql">
<level value="DEBUG" />
<appender_ref ref="dailyfile" />
</logger>
<logger name="mysql">
<level value="DEBUG" />
<appender_ref ref="dailyfile" />
</logger>
<appender name="dailyfile" class="LoggerAppenderDailyFile">
<param name="append" value="true" />
<param name="datePattern" value="Ymd" />
<param name="file" value="xyz.log" />
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{H:i:s}
%-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
<appender name="echo" class="LoggerAppenderEcho">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d
H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
<appender name="email" class="LoggerAppenderMailEvent">
<param name="from" value="mail@kfv.at" />
<param name="to" value="mail@kfv.at" />
<param name="subject" value="Error" />
<param name="smtpHost" value="0.0.0.0" />
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d
H:i:s} %-5p %c %X{username}: %m in %F at %L%n" />
</layout>
</appender>
</log4php:configuration>
But now there is nothing logged any more, so I think that any tags are not
configured properly...
Could you please check this?
Florian
Von:
Christian Grobmeier <gr...@gmail.com>
An:
Log4PHP User <lo...@logging.apache.org>
Datum:
03.03.2010 13:51
Betreff:
Re: Illogical logging by rootLogger
Hi,
at first glance, I would think the same. I will need to try it out.
However - please have in mind that the php configuration is still
experimental. Maybe you are running into a bug here. Did you try the old
fashioned way with xml or property file?
Christian
On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>
wrote:
I created the following log4php configuration file and wondered, why a
$logger->debug('xyz')
on ldap-logger created an formatted log4php-output on the webpage:
return array(
'rootLogger' => array(
'level' => 'FATAL',
'appenders' => array('echo'),
),
'loggers' => array(
'ldap' => array(
'level' => 'DEBUG',
'appenders' => array('email'),
),
),
'appenders' => array(
'echo' => array(
'class' => 'LoggerAppenderEcho',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
),
'email' => array(
'class' =>
'LoggerAppenderMailEvent',
'layout' => array(
'class' =>
'LoggerLayoutPattern',
'conversionPattern' =>
"%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
),
'from' => 'from@mail.com',
'to' => 'to@mail.com',
'subject' => 'Error',
'smtpHost' => '0.0.0.0',
),
),
);
In my understanding, the rootLogger only should log in case of FATAL
errors!?
Florian
Re: Illogical logging by rootLogger
Posted by Christian Grobmeier <gr...@gmail.com>.
Hi,
at first glance, I would think the same. I will need to try it out. However
- please have in mind that the php configuration is still experimental.
Maybe you are running into a bug here. Did you try the old fashioned way
with xml or property file?
Christian
On Wed, Mar 3, 2010 at 1:44 PM, Florian Platzer <Fl...@kfv.at>wrote:
> I created the following log4php configuration file and wondered, why a
>
> $logger->debug('xyz')
>
> on ldap-logger created an formatted log4php-output on the webpage:
>
> return array(
> 'rootLogger' => array(
> 'level' => 'FATAL',
> 'appenders' => array('echo'),
> ),
> 'loggers' => array(
> 'ldap' => array(
> 'level' => 'DEBUG',
> 'appenders' => array('email'),
> ),
> ),
> 'appenders' => array(
> 'echo' => array(
> 'class' => 'LoggerAppenderEcho',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> ),
> 'email' => array(
> 'class' =>
> 'LoggerAppenderMailEvent',
> 'layout' => array(
> 'class' =>
> 'LoggerLayoutPattern',
> 'conversionPattern' =>
> "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
> ),
> 'from' => 'from@mail.com',
> 'to' => 'to@mail.com',
> 'subject' => 'Error',
> 'smtpHost' => '0.0.0.0',
> ),
> ),
> );
>
>
> In my understanding, the rootLogger only should log in case of FATAL
> errors!?
>
> Florian
>
>