Hello Florian,

> i start the developing of a Log4PhpBundle for the Symfony2 framework. The 
> basic appenders like AppenderFile and AppenderRollingFile work fine. Now I 
> want to integrate the doctrine-service for the db logging. But there are some 
> probleme with die LoggerReflectionUtils::createObject(). My appender is a 
> full qualified classname with namespaces. So the createObject() execute 
> basename('Foo\AppenderBar') and remove the namespace: AppenderBar is the 
> return value. Of course the class AppenderBar  does not exist.
>
> I remove this line (LoggerReflectionUtils:131) in the method and it works 
> fine, with the basic appenders of log4php too.
>
> I don't want hack log4php. So is it possible to change/remove this line in 
> the public repository?

Actually I don't see a reason to leave this in code. At the moment, a
potential user is calling it the class must be already loaded. So it
doesn't make sense to give the fullqualified as argument. Guess it is
only there b/c of historical reasons.

The only thing to think about is backwards compatibility. Two options:

1) don't care on bc and remove the line
2) add an optional param to createObject, like: createObject($class,
[$usingNamespace]);

I would prefer #1, b/c would introduce a param for a php version we
currently don't support.

Ivan, what do you think?

Cheers
Christian

Reply via email to