Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

amenk
Copy link
Contributor

@amenk amenk commented Jul 18, 2012

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

@kirmorozov
Copy link
Member

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

@amenk
Copy link
Contributor Author

amenk commented Jul 18, 2012

Can you explain this further?

@kirmorozov
Copy link
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).

@colinmollenhour
Copy link

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
Copy link
Contributor Author

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
Copy link
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.

@magento-team
Copy link
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.

magento-team added a commit that referenced this pull request Sep 6, 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 mentioned this pull request Apr 3, 2015
@chrom chrom mentioned this pull request Oct 7, 2015
magento-team pushed a commit that referenced this pull request Oct 25, 2015
magento-engcom-team pushed a commit that referenced this pull request Aug 27, 2018
MAGETWO-66666: Adding a product to cart from category page with an ex…
magento-engcom-team pushed a commit that referenced this pull request May 30, 2021
@FabXav FabXav mentioned this pull request Oct 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants