On 30.4.2010 23:29, Christian Grobmeier wrote:
> Please feel free to add some documentation as patch. Just create an
> new issue and attach it there. There are reasons why Log4PHP is
> missing a -good- doc.

I know, everybody prefers coding to writing documentation. For starters, I'll add some more examples of XML configuration to the appenders page on the site. That's where most people will look first.

There was such an option before r2.0. Log4J has this option too. But
in the old code base it was badly readable and we doubted the sense of
this "feature". We thought that Log4PHP needs to be so easy that a
feature like "internal debugging" shouldn't be necessary. As a
consequence we deleted the internal logging code out from the
codebase. What you found is what we forgot. We should delete it out to
finalize this step.

I think that log4php should at the very least report errors and warning when parsing the configuration file. Internal debugging might not be necessary.

I was checking out LoggerConfiguratorXml, looking for ways to add some error reporting. The code for parsing XML is very ... non-linear. :)

There are several problems with this method of XML parsing:
* it is quite difficult to implement error reporting (you have to examine the $state stack to determine which error message to use) * the order of elements in the configuration is significant (then you get things like https://issues.apache.org/jira/browse/LOG4PHP-114). * it's difficult to discard a part of the configuration in which errors were detected

I presume the XML Parser extension was initially chosen for parsing because it is supported in both PHP 4 and 5. Is there any reason not to switch to a more user-friendly extension such as SimpleXML? I think it shouldn't be too much work to code, and the code would be much more flexible, not to mention more readable.

I am working under the assumption (and hope) that Log4PHP project does not support PHP 4. :)

I think E_USER_WARNING would be an option. Things like:
set_error_handler("customError",E_USER_WARNING);
will work then

OK, we agree on this one.

If you would go for this one I think this would be great. Log4PHP is
not so easy enough as I (and maybe others) would like to see it.

Great. I also think that this is a good step towards making Log4PHP more accessible to the general public.

Regards,
Ivan

Reply via email to