Added support for logging to php://output #44

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
@amenk
Contributor

amenk commented Jul 18, 2012

Sometimes - for example for shell scripts - it is usefull to log directly to the console.

@kirmorozov

This comment has been minimized.

Show comment Hide comment
@kirmorozov

kirmorozov Jul 18, 2012

Member

Isn't it better to use different Zend_Log_Writers?
and get rid of hardcode?

Member

kirmorozov commented Jul 18, 2012

Isn't it better to use different Zend_Log_Writers?
and get rid of hardcode?

@amenk

This comment has been minimized.

Show comment Hide comment
@amenk

amenk Jul 18, 2012

Contributor

Can you explain this further?

Contributor

amenk commented Jul 18, 2012

Can you explain this further?

@kirmorozov

This comment has been minimized.

Show comment Hide comment
@kirmorozov

kirmorozov Jul 18, 2012

Member

A while ago I was trying to replace Zend_Log_Writer_Stream with Firebug for debugging purposes.
Also tried use Syslog to collect all logs from several frontend servers.
Mail Writer also can be useful.

I think It's better to keep all parameters in configuration.

Looks like file parameter can be replaced to some sort of name of configuration(writer + parameters).

Member

kirmorozov commented Jul 18, 2012

A while ago I was trying to replace Zend_Log_Writer_Stream with Firebug for debugging purposes.
Also tried use Syslog to collect all logs from several frontend servers.
Mail Writer also can be useful.

I think It's better to keep all parameters in configuration.

Looks like file parameter can be replaced to some sort of name of configuration(writer + parameters).

@colinmollenhour

This comment has been minimized.

Show comment Hide comment
@colinmollenhour

colinmollenhour Jul 18, 2012

In the case of php://output I personally would probably just use echo, but using php://stderr could be useful so I support this patch and don't think this case justifies a separate writer since it is just determining whether or not to add the path prefix.

For some really advanced logging features check out https://github.com/magento-hackathon/Logger.

Screenshot

In the case of php://output I personally would probably just use echo, but using php://stderr could be useful so I support this patch and don't think this case justifies a separate writer since it is just determining whether or not to add the path prefix.

For some really advanced logging features check out https://github.com/magento-hackathon/Logger.

Screenshot

@amenk

This comment has been minimized.

Show comment Hide comment
@amenk

amenk Jul 19, 2012

Contributor

To good thing about the logger is the timestamp etc. You do not get this so easily when using echo :-)

Contributor

amenk commented Jul 19, 2012

To good thing about the logger is the timestamp etc. You do not get this so easily when using echo :-)

@magento-team

This comment has been minimized.

Show comment Hide comment
@magento-team

magento-team Aug 23, 2012

Contributor

@amenk
In fact, Magento writes logs through Zend_Log_Writer_Stream, which allows to pass wrappers instead of real files. So, existing limitation is excessive.

The contribution has been accepted, but implemented in a slightly different way to support any wrapper, not just php://, for example ftp:// and others can be also pretty useful.
Automated tests were missing in the contribution, so we have implemented them. However, next time make sure to supply a contribution with relevant unit/integration tests.

Change will be available with one of the nearest code publications to the GitHub. Closing the ticket.

Contributor

magento-team commented Aug 23, 2012

@amenk
In fact, Magento writes logs through Zend_Log_Writer_Stream, which allows to pass wrappers instead of real files. So, existing limitation is excessive.

The contribution has been accepted, but implemented in a slightly different way to support any wrapper, not just php://, for example ftp:// and others can be also pretty useful.
Automated tests were missing in the contribution, so we have implemented them. However, next time make sure to supply a contribution with relevant unit/integration tests.

Change will be available with one of the nearest code publications to the GitHub. Closing the ticket.

@magento-team

This comment has been minimized.

Show comment Hide comment
@magento-team

magento-team Aug 27, 2012

Contributor

In addition, we have modified Mage::log() a bit, so that it would actually clearly enforce Zend_Log_Writer_Stream or a descendant specified in global/log/core/writer_model node. To support Zend_Log_Writer_Abstract descendants, we'd have to modify interface of their declaration, because they have different interface.

Contributor

magento-team commented Aug 27, 2012

In addition, we have modified Mage::log() a bit, so that it would actually clearly enforce Zend_Log_Writer_Stream or a descendant specified in global/log/core/writer_model node. To support Zend_Log_Writer_Abstract descendants, we'd have to modify interface of their declaration, because they have different interface.

magento-team added a commit that referenced this pull request Sep 6, 2012

Update as of 9/05/2012
* Implemented encryption of the credit card name and expiration date for the payment method "Credit Card (saved)"
* Implemented console utility `dev/tools/migration/get_aliases_map.php`, which generates map file "M1 class alias" to "M2 class name"
* Implemented automatic data upgrades for replacing "M1 class aliases" to "M2 class names" in a database
* Implemented recursive `chmod` in the library class `Varien_Io_File`
* Improved verbosity of the library class `Magento_Shell`
* Migrated client-side translation mechanism to jQuery
* Performance tests:
  * Improved assertion for number of created orders for the checkout performance testing scenario
    * Reverted the feature of specifying PHP scenarios to be executed before and after a JMeter scenario
    * Implemented validation for the number of created orders as a part of the JMeter scenario
    * Implemented the "Admin Login" user activity as a separate file to be reused in the performance testing scenarios
  * Implemented fixture of 100k customers for the performance tests
  * Implemented fixture of 100k products for the performance tests
    * Enhanced module `Mage_ImportExport` in order to utilize it for the fixture implementation
  * Implemented back-end performance testing scenario, which covers Dashboard, Manage Products, Manage Customers pages
* Fixes:
  * Fixed Magento console installer to enable write permission recursively to the `var` directory
  * Fixed performance tests to enable write permission recursively to the `var` directory
  * Fixed integration test `Mage_Adminhtml_Model_System_Config_Source_Admin_PageTest::testToOptionArray` to not produce "Warning: DOMDocument::loadHTML(): htmlParseEntityRef: expecting ';' in Entity" in the developer mode
* GitHub requests:
  * [#43](#43) -- implemented logging of executed setup files
  * [#44](#44)
    * Implemented support of writing logs into wrappers (for example, `php://output`)
    * Enforced a log writer model to be an instance of `Zend_Log_Writer_Stream`
  * [#49](#49)
    * Fixed sorting of totals according to "before" and "after" properties
    * Introduced `Magento_Data_Graph` library class and utilized it for finding cycles in "before" and "after" declarations
    * Implemented tests for totals sorting including the ambiguous cases

magento-team pushed a commit that referenced this pull request Jan 23, 2015

@stevieyu stevieyu referenced this pull request Apr 3, 2015

Closed

locale bug #1164

@chrom chrom referenced this pull request Oct 7, 2015

Closed

error when try install #2023

@cfcnn cfcnn referenced this pull request Oct 11, 2015

Closed

I can not install magento2 #2080

magento-team pushed a commit that referenced this pull request Oct 25, 2015

@abi2 abi2 referenced this pull request Sep 19, 2016

Closed

Sales Email Error #6667

@rratinov rratinov referenced this pull request Oct 6, 2017

Closed

Site not open correctly #11278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment