Need help integrating log4php

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need help integrating log4php

Jan Galler
Hey guys,

Is this mailing-list still working?


Jan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help integrating log4php

Christian grobmeier
Sure!

On Fri, Aug 2, 2013 at 2:40 PM, Jan Galler <[hidden email]> wrote:
> Hey guys,
>
> Is this mailing-list still working?
>
>
> Jan



--
http://www.grobmeier.de
https://www.timeandbill.de
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help integrating log4php

Jan Galler
Thanks Christian,

I didn't find any hint to the mailing-list at http://logging.apache.org/log4php/ that's why I asked.

So, I already used log4php in a project but now (I'm new to php oop) I can't get it working.
I use this method to setup my log4php instance:

function setUpLogger()
{
$logger = \Logger::getLogger("main");

// configure the logging framework to use database
\Logger::configure(
array(
'appenders' => array(
'default' => array(
'class' => 'LoggerAppenderPDO',
'params' => array(
'dsn' => 'mysql:host='.DB_HOST.';port='.DB_PORT.';dbName='.DB_NAME,
'user' => DB_USER,
'password' => DB_PASS,
'table' => GENERAL_LOG_TABLE,
),
),
),
'rootLogger' => array(
'appenders' => array('default'),
),
)
);

return $logger;
}

That works fine, without errors and the defines are filled with the right values.

Now I just call $logger->info("test"); and the only thing I get is error:
Fatal error</b>:  Class 'LoggerLoggingEvent' not found in <b>/API/log4php/Logger.php</b> on line <b>173</b>

Can someone give me some advise me?


Best wishes from Germany,
Jan



On 02.08.2013, at 14:41, Christian Grobmeier <[hidden email]> wrote:

Sure!

On Fri, Aug 2, 2013 at 2:40 PM, Jan Galler <[hidden email]> wrote:
Hey guys,

Is this mailing-list still working?


Jan



--
http://www.grobmeier.de
https://www.timeandbill.de

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help integrating log4php

Christian grobmeier
On Fri, Aug 2, 2013 at 2:49 PM, Jan Galler <[hidden email]> wrote:
> Thanks Christian,
>
> I didn't find any hint to the mailing-list at
> http://logging.apache.org/log4php/ that's why I asked.

Its here: http://logging.apache.org/log4php/mail-lists.html
:-)

>
...
> That works fine, without errors and the defines are filled with the right
> values.
>
> Now I just call $logger->info("test"); and the only thing I get is error:
>
> Fatal error</b>:  Class 'LoggerLoggingEvent' not found in
> <b>/API/log4php/Logger.php</b> on line <b>173</b>

The "test" string will be transformed into a LoggerLoggingEvent.

As you already loaded the Logger class, you should also have loaded the
autoloader: http://svn.apache.org/repos/asf/logging/log4php/trunk/src/main/php/LoggerAutoloader.php

For some reason it seems you still are not able to load the class.

Can you somehow find out if the loggerAutoloader works for you? maybe
with outputting something.
My guess is the problem relates to namespaces

Cheers (from germany too)


>
>
> Can someone give me some advise me?
>
>
> Best wishes from Germany,
> Jan
>
>
>
> On 02.08.2013, at 14:41, Christian Grobmeier <[hidden email]> wrote:
>
> Sure!
>
> On Fri, Aug 2, 2013 at 2:40 PM, Jan Galler <[hidden email]> wrote:
>
> Hey guys,
>
> Is this mailing-list still working?
>
>
> Jan
>
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
>



--
http://www.grobmeier.de
https://www.timeandbill.de
Loading...