Skip to content

Commit

Permalink
if a INSTALLATION_NAME exists, the logger will now use is for better …
Browse files Browse the repository at this point in the history
…identify
  • Loading branch information
hertsch committed Oct 20, 2013
1 parent 72f362a commit 893a31f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bootstrap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ elseif (!file_exists(SYNCDATA_PATH.'/logfile') && (true !== @mkdir(SYNCDATA_PATH

// initialize the logger
$app['monolog'] = $app->share(function($app) {
return new Logger('SyncData');
// if possible use the INSTALLATION_NAME additional to 'SyncData' as logger name
$LoggerName = (false !== ($inst_name = $app['utils']->parseFileForConstants(realpath(SYNCDATA_PATH.'/../config.php'), 'INSTALLATION_NAME'))) ? "SyncData.$inst_name" : 'SyncData';
return new Logger($LoggerName);
});
$app['monolog']->pushHandler(new StreamHandler($log_file, LOGGER_LEVEL));
$app['monolog']->addInfo('Monolog initialized');
Expand Down

0 comments on commit 893a31f

Please sign in to comment.