Spécification des chemins pour les logs en production
This commit is contained in:
parent
4d8bd3b6d9
commit
c1da5450d9
@ -23,9 +23,17 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
require_once 'Zend/Log.php';
|
||||
require_once 'Zend/Mail.php';
|
||||
|
||||
$pathLog = '';
|
||||
if (in_array(APPLICATION_ENV, array('production','staging')) )
|
||||
{
|
||||
$pathLog = '/var/log/webservice';
|
||||
if ( !is_dir($logPath) ){ mkdir($pathLog); }
|
||||
$pathLog.= '/';
|
||||
}
|
||||
|
||||
$WsLogger = new Zend_Log();
|
||||
|
||||
$WsFileWriter = new Zend_Log_Writer_Stream('wsentreprise.log');
|
||||
$WsFileWriter = new Zend_Log_Writer_Stream($pathLog . 'wsentreprise.log');
|
||||
$WsFileWriter->addFilter(Zend_Log::INFO);
|
||||
$WsLogger->addWriter($WsFileWriter);
|
||||
|
||||
@ -40,7 +48,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
$WsLogger->addWriter($WsMailWriter);
|
||||
}
|
||||
|
||||
$AppFileWriter = new Zend_Log_Writer_Stream('application.log');
|
||||
$AppFileWriter = new Zend_Log_Writer_Stream($pathLog . 'application.log');
|
||||
$AppFileWriter->addFilter(Zend_Log::ERR);
|
||||
$AppLogger = new Zend_Log();
|
||||
$AppLogger->addWriter($AppFileWriter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user