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/09/09 02:41:57 UTC
[jira] Created: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
-----------------------------------------------------------------------------------
Key: LOG4PHP-81
URL: https://issues.apache.org/jira/browse/LOG4PHP-81
Project: Log4php
Issue Type: Bug
Components: Code
Reporter: Christian Hammers
Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
As I was bitten by this bug myself for the third time now I tried to fix it :)
The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
bye,
-christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Posted by "Christian Hammers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Hammers updated LOG4PHP-81:
-------------------------------------
Attachment: LoggerOptionConverterTest.php
phpunit test
> Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-81
> URL: https://issues.apache.org/jira/browse/LOG4PHP-81
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Reporter: Christian Hammers
> Attachments: layout_ttcc.php, LoggerOptionConverterTest.php
>
>
> Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
> This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
> Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
> As I was bitten by this bug myself for the third time now I tried to fix it :)
> The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Posted by "Christian Hammers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Hammers updated LOG4PHP-81:
-------------------------------------
Attachment: layout_ttcc.properties
example properties
> Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-81
> URL: https://issues.apache.org/jira/browse/LOG4PHP-81
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Reporter: Christian Hammers
> Attachments: layout_ttcc.php, layout_ttcc.properties, LoggerOptionConverterTest.php
>
>
> Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
> This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
> Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
> As I was bitten by this bug myself for the third time now I tried to fix it :)
> The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Posted by "Christian Hammers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Hammers updated LOG4PHP-81:
-------------------------------------
Fix Version/s: 2.0
> Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-81
> URL: https://issues.apache.org/jira/browse/LOG4PHP-81
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Reporter: Christian Hammers
> Fix For: 2.0
>
> Attachments: BooleansInProperties.diff, layout_ttcc.php, layout_ttcc.properties, LoggerOptionConverterTest.php
>
>
> Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
> This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
> Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
> As I was bitten by this bug myself for the third time now I tried to fix it :)
> The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Posted by "Christian Hammers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Hammers updated LOG4PHP-81:
-------------------------------------
Attachment: BooleansInProperties.diff
The patch. Basically it does three things:
1. LoggerOptionConvert::findAndSubst() no longer tries to be clever and skips settings where empty($value)==true because PHPs parse_ini_file() already converts a false without quotes to an empty string.
2. As the generic options parser cannot distinguish if the user has written the number 0 or the boolean false (both is converted to string(1)"0" by parse_ini_file()) etc. the conversion has to be done in the setter methods because only they know if they want numbers or booleans for their attributes.
3. Those setter methods can use the already existing toBoolean() method. Although until now it did not handle all cases that parse_ini_file() mangles correctly.
> Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-81
> URL: https://issues.apache.org/jira/browse/LOG4PHP-81
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Reporter: Christian Hammers
> Attachments: BooleansInProperties.diff, layout_ttcc.php, layout_ttcc.properties, LoggerOptionConverterTest.php
>
>
> Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
> This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
> Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
> As I was bitten by this bug myself for the third time now I tried to fix it :)
> The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Posted by "Christian Hammers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Hammers updated LOG4PHP-81:
-------------------------------------
Attachment: layout_ttcc.php
example php
> Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-81
> URL: https://issues.apache.org/jira/browse/LOG4PHP-81
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Reporter: Christian Hammers
> Attachments: layout_ttcc.php, LoggerOptionConverterTest.php
>
>
> Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
> This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
> Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
> As I was bitten by this bug myself for the third time now I tried to fix it :)
> The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (LOG4PHP-81) Boolean values in .properties files
and incorrectly parsed by LoggerConfiguratorIni
Posted by "Christian Hammers (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Hammers resolved LOG4PHP-81.
--------------------------------------
Resolution: Fixed
Assignee: Christian Hammers
fixed in svn
> Boolean values in .properties files and incorrectly parsed by LoggerConfiguratorIni
> -----------------------------------------------------------------------------------
>
> Key: LOG4PHP-81
> URL: https://issues.apache.org/jira/browse/LOG4PHP-81
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Reporter: Christian Hammers
> Assignee: Christian Hammers
> Fix For: 2.0
>
> Attachments: BooleansInProperties.diff, layout_ttcc.php, layout_ttcc.properties, LoggerOptionConverterTest.php
>
>
> Currently boolean values in log4php.properties have to be written as "true" and "false", i.e. as strings because they do not get parsed correctly else.
> This is quite irritating as the ini file format as well as the name of the configurator suggests that this file does behave like a PHP .ini file where true/false/on/off etc. can be used.
> Moreover it is no problem with log4j and the properties files should be interchangeable if possible.
> As I was bitten by this bug myself for the third time now I tried to fix it :)
> The patch currently only fixes LoggerLayoutTTCC and most probably breaks a whole lot of other stuff but it shows the right way, I guess.
> bye,
> -christian-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.