PHP Yii::setLogger Examples

PHP Yii::setLogger - 2 examples found. These are the top rated real world PHP examples of Yii::setLogger extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 public static function logFile($msg, $level = CLogger::LEVEL_INFO, $category = 'application')
 {
     $logger = Yii::getLogger();
     if ($logger === null) {
         $logger = new CLogger();
         Yii::setLogger($logger);
     }
     $logger->log($msg, $level, $category);
 }
Example #2
0
 public function startApp()
 {
     $config = (require $this->configFile);
     if (!isset($config['class'])) {
         $config['class'] = 'yii\\web\\Application';
     }
     /** @var \yii\web\Application $app */
     $this->app = Yii::createObject($config);
     $this->persistDb();
     $this->mockMailer($config);
     $this->mockAssetManager();
     \Yii::setLogger(new Logger());
 }