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 Jan Galler <ja...@icloud.com> on 2013/08/02 14:40:03 UTC

Need help integrating log4php

Hey guys,

Is this mailing-list still working?


Jan

Re: Need help integrating log4php

Posted by Christian Grobmeier <gr...@gmail.com>.
On Fri, Aug 2, 2013 at 2:49 PM, Jan Galler <ja...@icloud.com> 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 <gr...@gmail.com> wrote:
>
> Sure!
>
> On Fri, Aug 2, 2013 at 2:40 PM, Jan Galler <ja...@icloud.com> 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

Re: Need help integrating log4php

Posted by Jan Galler <ja...@icloud.com>.
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 <gr...@gmail.com> wrote:

> Sure!
> 
> On Fri, Aug 2, 2013 at 2:40 PM, Jan Galler <ja...@icloud.com> wrote:
>> Hey guys,
>> 
>> Is this mailing-list still working?
>> 
>> 
>> Jan
> 
> 
> 
> -- 
> http://www.grobmeier.de
> https://www.timeandbill.de


Re: Need help integrating log4php

Posted by Christian Grobmeier <gr...@gmail.com>.
Sure!

On Fri, Aug 2, 2013 at 2:40 PM, Jan Galler <ja...@icloud.com> wrote:
> Hey guys,
>
> Is this mailing-list still working?
>
>
> Jan



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