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 "darja (JIRA)" <ji...@apache.org> on 2010/06/07 15:07:40 UTC
[jira] Created: (LOG4PHP-119) Formatted logs
Formatted logs
--------------
Key: LOG4PHP-119
URL: https://issues.apache.org/jira/browse/LOG4PHP-119
Project: Log4php
Issue Type: New Feature
Components: Code
Reporter: darja
Priority: Minor
In log4net there is a set of functions for formatted logs - InfoFormat, DebugFormat, etc. They are using System.String.Format for outputing logs. So, in log4net we can write:
Logger.DebugFormat("Object1: {0}, Object2: {2}", obj1, obj2);
And in log4php we need
$logger->debug("Object1:");
$logger->debug($obj1);
$logger->debug("Object2:");
$logger->debug($obj2);
Obviously, log4net way is more applicable. It will be great to implement something like this in log4php.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LOG4PHP-119) Formatted logs
Posted by "Curt Arnold (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877276#action_12877276 ]
Curt Arnold commented on LOG4PHP-119:
-------------------------------------
Should also consider LogMF and LogSF from log4j and the parameterized logging methods in SLF4J.
Equivalent in LogMF would be
LogMF.debug(logger, "Object1: {0}, Object2: {1}", obj1, obj2);
Equivalent with SLF4J would be:
logger.debug("Object1: {}, Object2: {}", obj1, obj2);
> Formatted logs
> --------------
>
> Key: LOG4PHP-119
> URL: https://issues.apache.org/jira/browse/LOG4PHP-119
> Project: Log4php
> Issue Type: New Feature
> Components: Code
> Reporter: Darja Ryazhskikh
> Priority: Minor
> Attachments: log4php_format.patch
>
>
> In log4net there is a set of functions for formatted logs - InfoFormat, DebugFormat, etc. They are using System.String.Format for outputing logs. So, in log4net we can write:
> Logger.DebugFormat("Object1: {0}, Object2: {1}", obj1, obj2);
> And in log4php we need
> $logger->debug("Object1:");
> $logger->debug($obj1);
> $logger->debug("Object2:");
> $logger->debug($obj2);
> Obviously, log4net way is more applicable. It will be great to implement something like this in log4php.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-119) Formatted logs
Posted by "darja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
darja updated LOG4PHP-119:
--------------------------
Attachment: log4php_format.patch
This patch implements such functionality using sprintf function. There are also several tests.
> Formatted logs
> --------------
>
> Key: LOG4PHP-119
> URL: https://issues.apache.org/jira/browse/LOG4PHP-119
> Project: Log4php
> Issue Type: New Feature
> Components: Code
> Reporter: darja
> Priority: Minor
> Attachments: log4php_format.patch
>
>
> In log4net there is a set of functions for formatted logs - InfoFormat, DebugFormat, etc. They are using System.String.Format for outputing logs. So, in log4net we can write:
> Logger.DebugFormat("Object1: {0}, Object2: {2}", obj1, obj2);
> And in log4php we need
> $logger->debug("Object1:");
> $logger->debug($obj1);
> $logger->debug("Object2:");
> $logger->debug($obj2);
> Obviously, log4net way is more applicable. It will be great to implement something like this in log4php.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LOG4PHP-119) Formatted logs
Posted by "darja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4PHP-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
darja updated LOG4PHP-119:
--------------------------
Description:
In log4net there is a set of functions for formatted logs - InfoFormat, DebugFormat, etc. They are using System.String.Format for outputing logs. So, in log4net we can write:
Logger.DebugFormat("Object1: {0}, Object2: {1}", obj1, obj2);
And in log4php we need
$logger->debug("Object1:");
$logger->debug($obj1);
$logger->debug("Object2:");
$logger->debug($obj2);
Obviously, log4net way is more applicable. It will be great to implement something like this in log4php.
was:
In log4net there is a set of functions for formatted logs - InfoFormat, DebugFormat, etc. They are using System.String.Format for outputing logs. So, in log4net we can write:
Logger.DebugFormat("Object1: {0}, Object2: {2}", obj1, obj2);
And in log4php we need
$logger->debug("Object1:");
$logger->debug($obj1);
$logger->debug("Object2:");
$logger->debug($obj2);
Obviously, log4net way is more applicable. It will be great to implement something like this in log4php.
> Formatted logs
> --------------
>
> Key: LOG4PHP-119
> URL: https://issues.apache.org/jira/browse/LOG4PHP-119
> Project: Log4php
> Issue Type: New Feature
> Components: Code
> Reporter: darja
> Priority: Minor
> Attachments: log4php_format.patch
>
>
> In log4net there is a set of functions for formatted logs - InfoFormat, DebugFormat, etc. They are using System.String.Format for outputing logs. So, in log4net we can write:
> Logger.DebugFormat("Object1: {0}, Object2: {1}", obj1, obj2);
> And in log4php we need
> $logger->debug("Object1:");
> $logger->debug($obj1);
> $logger->debug("Object2:");
> $logger->debug($obj2);
> Obviously, log4net way is more applicable. It will be great to implement something like this in log4php.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.