From 6bb29ea03b3cbc8dcea9ba156f8e2e4f994b86f7 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Tue, 15 May 2012 08:06:09 +0700 Subject: [PATCH] changing CakeLog::_autoConfig for better bc closes #2880 --- lib/Cake/Log/CakeLog.php | 3 +-- lib/Cake/Test/Case/Log/CakeLogTest.php | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Log/CakeLog.php b/lib/Cake/Log/CakeLog.php index a2e4d7604..8834b2b1d 100644 --- a/lib/Cake/Log/CakeLog.php +++ b/lib/Cake/Log/CakeLog.php @@ -285,9 +285,8 @@ class CakeLog { * @return void */ protected static function _autoConfig() { - self::$_Collection->load('error', array( + self::$_Collection->load('default', array( 'engine' => 'FileLog', - 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'path' => LOGS, )); } diff --git a/lib/Cake/Test/Case/Log/CakeLogTest.php b/lib/Cake/Test/Case/Log/CakeLogTest.php index 92eda8746..d39dcb6eb 100644 --- a/lib/Cake/Test/Case/Log/CakeLogTest.php +++ b/lib/Cake/Test/Case/Log/CakeLogTest.php @@ -126,8 +126,14 @@ class CakeLogTest extends CakeTestCase { $this->assertTrue(file_exists(LOGS . 'error.log')); $result = CakeLog::configured(); - $this->assertEquals(array('error'), $result); + $this->assertEquals(array('default'), $result); + + $testMessage = 'custom message'; + CakeLog::write('custom', $testMessage); + $content = file_get_contents(LOGS . 'custom.log'); + $this->assertContains($testMessage, $content); unlink(LOGS . 'error.log'); + unlink(LOGS . 'custom.log'); } /**