Browse Source

changing CakeLog::_autoConfig for better bc

closes #2880
Rachman Chavik 14 years ago
parent
commit
6bb29ea03b
2 changed files with 8 additions and 3 deletions
  1. 1 2
      lib/Cake/Log/CakeLog.php
  2. 7 1
      lib/Cake/Test/Case/Log/CakeLogTest.php

+ 1 - 2
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,
 		));
 	}

+ 7 - 1
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');
 	}
 
 /**