aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Log.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Minz/Log.php')
-rw-r--r--lib/Minz/Log.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Minz/Log.php b/lib/Minz/Log.php
index d19edc1dc..2063efe7e 100644
--- a/lib/Minz/Log.php
+++ b/lib/Minz/Log.php
@@ -31,10 +31,15 @@ class Minz_Log {
* @param $file_name fichier de log
*/
public static function record ($information, $level, $file_name = null) {
- $env = Minz_Configuration::environment ();
+ try {
+ $conf = Minz_Configuration::get('system');
+ $env = $conf->general['environment'];
+ } catch (Minz_ConfigurationException $e) {
+ $env = 'production';
+ }
- if (! ($env === Minz_Configuration::SILENT
- || ($env === Minz_Configuration::PRODUCTION
+ if (! ($env === 'silent'
+ || ($env === 'production'
&& ($level >= Minz_Log::NOTICE)))) {
if ($file_name === null) {
$file_name = join_path(USERS_PATH, Minz_Session::param('currentUser', '_'), 'log.txt');