changing CakeLog::_autoConfig for better bc

closes #2880
This commit is contained in:
Rachman Chavik 2012-05-15 08:06:09 +07:00
parent 405aacc0fc
commit 6bb29ea03b
2 changed files with 8 additions and 3 deletions

View file

@ -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,
));
}

View file

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