Skip to content

Commit

Permalink
changing CakeLog::_autoConfig for better bc
Browse files Browse the repository at this point in the history
closes #2880
  • Loading branch information
rchavik committed May 15, 2012
1 parent 405aacc commit 6bb29ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Log/CakeLog.php
Expand Up @@ -285,9 +285,8 @@ public static function stream($streamName) {
* @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,
));
}
Expand Down
8 changes: 7 additions & 1 deletion lib/Cake/Test/Case/Log/CakeLogTest.php
Expand Up @@ -126,8 +126,14 @@ public function testAutoConfig() {
$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');
}

/**
Expand Down

0 comments on commit 6bb29ea

Please sign in to comment.