Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Changd logging configuration, see issue #34
Browse files Browse the repository at this point in the history
The logging levels work now as intended. In DEBUG mode a file log is
created.
  • Loading branch information
rvolz committed Mar 31, 2013
1 parent c797e40 commit 13d5fd3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
require 'vendor/autoload.php';
require_once 'vendor/slim/slim/Slim/View.php';
require_once 'vendor/slim/extras/Log/FileWriter.php';
require_once 'lib/BicBucStriim/langs.php';
require_once 'lib/BicBucStriim/l10n.php';
require_once 'lib/BicBucStriim/bicbucstriim.php';
Expand Down Expand Up @@ -77,12 +78,12 @@ function confprod() {
global $app, $appname, $appversion;
$app->config(array(
'debug' => false,
'log.enabled' => true,
'log.level' => 3,
'cookies.lifetime' => '1 day',
'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',

));
$app->getLog()->setEnabled(true);
$app->getLog()->setLevel(Slim_Log::WARN);
$app->getLog()->info($appname.' '.$appversion.': Running in production mode.');
}

Expand All @@ -93,13 +94,13 @@ function confdev() {
global $app, $appname, $appversion;
$app->config(array(
'debug' => true,
'log.enabled' => true,
'log.level' => 4,
'cookies.lifetime' => '5 minutes',
'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',

));
$app->get('/dev/reset', 'devReset');
$app->getLog()->setEnabled(true);
$app->getLog()->setLevel(Slim_Log::DEBUG);
$app->getLog()->info($appname.' '.$appversion.': Running in development mode.');
}

Expand All @@ -110,12 +111,12 @@ function confdebug() {
global $app, $appname, $appversion;
$app->config(array(
'debug' => true,
'log.enabled' => true,
'log.writer' => new Slim_LogFileWriter(fopen('./data/bbs.log','a')),
'log.level' => 4,
'cookies.lifetime' => '1 day',
'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',
));
$app->getLog()->setEnabled(true);
$app->getLog()->setLevel(Slim_Log::DEBUG);
$app->getLog()->setWriter(new Log_FileWriter(array('path' => './data', 'name_format' => 'Y-m-d\.\l\o\g')));
$app->getLog()->info($appname.' '.$appversion.': Running in debug mode.');
}

Expand Down

0 comments on commit 13d5fd3

Please sign in to comment.