You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by "Christian Hammers (JIRA)" <ji...@apache.org> on 2009/10/11 01:50:31 UTC

[jira] Closed: (LOG4PHP-80) Trying to set unknown properties should result in an exception

     [ https://issues.apache.org/jira/browse/LOG4PHP-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Hammers closed LOG4PHP-80.
------------------------------------

    Resolution: Fixed
      Assignee: Christian Hammers

fixed in svn

> Trying to set unknown properties should result in an exception
> --------------------------------------------------------------
>
>                 Key: LOG4PHP-80
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-80
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>            Reporter: Christian Hammers
>            Assignee: Christian Hammers
>             Fix For: 2.0
>
>
> While it's arguable if logging problems during the program execution should or should not terminate the program, I'm strongly in favour of raising an exception if the properties file contains illegal options.
> Currently there is not even a warning if the user makes a typo!
> --- src/main/php/LoggerReflectionUtils.php      (Revision 812666)
> +++ src/main/php/LoggerReflectionUtils.php      (Arbeitskopie)
> @@ -107,8 +112,7 @@
>                 $method = "set" . ucfirst($name);
>                 if(!method_exists($this->obj, $method)) {
> -                       // no such setter method
> -                       return;
> +                       throw new Exception("Error setting log4php property $name to $value: no method $method in class ".get_class($this->obj)."!");
>                 } else {
>                         return call_user_func(array($this->obj, $method), $value);
>                 }
> The error then looks like:
>   Exception: Error setting log4php property categoryPrefixxing to 1: no method setCategoryPrefixxing in class LoggerLayoutTTCC! in ...
> bye,
> -christian-

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.