From f8df82d10d848030043655f97263e1bcbd6a3c4d Mon Sep 17 00:00:00 2001 From: Jan-Simon Winkelmann Date: Tue, 6 May 2014 11:04:20 +0200 Subject: [PATCH 1/5] Implement custom logging as per issue #510 --- .../Nexcessnet/Turpentine/Helper/Debug.php | 31 ++++++++++++++++++- .../Nexcessnet/Turpentine/etc/config.xml | 4 +++ .../Nexcessnet/Turpentine/etc/system.xml | 30 ++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/Helper/Debug.php b/app/code/community/Nexcessnet/Turpentine/Helper/Debug.php index 5c27702b9..03bae0ea8 100644 --- a/app/code/community/Nexcessnet/Turpentine/Helper/Debug.php +++ b/app/code/community/Nexcessnet/Turpentine/Helper/Debug.php @@ -135,10 +135,39 @@ public function logValue( $value, $name=null ) { */ protected function _log( $level, $message ) { $message = 'TURPENTINE: ' . $message; - Mage::log( $message, $level ); + Mage::log( $message, $level, $this->_getLogFileName() ); return $message; } + /** + * Get the name of the log file to use + * @return string + */ + protected function _getLogFileName() { + if ( $this->useCustomLogFile() ) { + return $this->getCustomLogFileName(); + } + return ''; + } + + /** + * Check if custom log file should be used + * @return bool + */ + public function useCustomLogFile() { + return Mage::getStoreConfigFlag( + 'turpentine_varnish/logging/use_custom_log_file' ); + } + + /** + * Get custom log file name + * @return string + */ + public function getCustomLogFileName() { + return (string)Mage::getStoreConfig( + 'turpentine_varnish/logging/custom_log_file_name' ); + } + /** * Format a list of function arguments for the backtrace * diff --git a/app/code/community/Nexcessnet/Turpentine/etc/config.xml b/app/code/community/Nexcessnet/Turpentine/etc/config.xml index c689b447e..44b8aa6b0 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/config.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/config.xml @@ -35,6 +35,10 @@ 0 0 + + 0 + turpentine.log + auto 127.0.0.1:6082 diff --git a/app/code/community/Nexcessnet/Turpentine/etc/system.xml b/app/code/community/Nexcessnet/Turpentine/etc/system.xml index 21de3942a..91f8677de 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/system.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/system.xml @@ -124,6 +124,36 @@ + + + 15 + 1 + 0 + 0 + + + + Log to custom log file rather than system.log + select + turpentine/config_select_toggle + 10 + 1 + 0 + 0 + + + + text + 20 + 1 + 0 + 0 + + 1 + + + + text From f6a874ed6af93e34a016841055aeeec6029f81f7 Mon Sep 17 00:00:00 2001 From: aricwatson Date: Wed, 24 Jun 2015 15:31:42 -0400 Subject: [PATCH 2/5] fix for #801 - recently viewed products Needed an ESI policy for left.reports.product.viewed --- .../base/default/layout/turpentine_esi.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/design/frontend/base/default/layout/turpentine_esi.xml b/app/design/frontend/base/default/layout/turpentine_esi.xml index 9bcc07fb1..1ca2f9b6e 100644 --- a/app/design/frontend/base/default/layout/turpentine_esi.xml +++ b/app/design/frontend/base/default/layout/turpentine_esi.xml @@ -198,6 +198,20 @@ + + + + + + private + + + + + + + + From 616cacbc84cbb8f66ba678c8632afc1fd5046314 Mon Sep 17 00:00:00 2001 From: aricwatson Date: Thu, 25 Jun 2015 13:39:56 -0400 Subject: [PATCH 3/5] Updated to include recently viewed products fix --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23bd93b3f..1526bb6d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -391,4 +391,5 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess * [#499] Use rewrite instead of local Session model for form key handling (@eth8505) * [#817] Damian/cache management extended. Added validations for EE and Full Page cache (@damian-pastorini) * [#521] Fix for search input field on search results page (@jeroenvermeulen) + * Fix for recently viewed products block in CE 1.9.1 (Issue #801) From 99084c6471b4dc24673c72f2abd140fc0ea73aeb Mon Sep 17 00:00:00 2001 From: Miguel Balparda Date: Fri, 26 Jun 2015 13:39:04 +0000 Subject: [PATCH 4/5] refs CHANGELOG.md #522. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1526bb6d0..a450bb9e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -392,4 +392,4 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess * [#817] Damian/cache management extended. Added validations for EE and Full Page cache (@damian-pastorini) * [#521] Fix for search input field on search results page (@jeroenvermeulen) * Fix for recently viewed products block in CE 1.9.1 (Issue #801) - + * [#522] Custom log file (issue #510) (@eth8505) From 21c3b824fea52c9789f41f519928165e8f5980bf Mon Sep 17 00:00:00 2001 From: Miguel Balparda Date: Fri, 26 Jun 2015 13:48:26 +0000 Subject: [PATCH 5/5] refs Comment for field #522. --- app/code/community/Nexcessnet/Turpentine/etc/system.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/community/Nexcessnet/Turpentine/etc/system.xml b/app/code/community/Nexcessnet/Turpentine/etc/system.xml index bb7da8623..fce48ecfd 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/system.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/system.xml @@ -145,7 +145,8 @@ text 20 - 1 + Only enter a file name, no paths. + 1 0 0