src/Sokil/Mongo/Yii/LogRoute.php
protected function processLogs($logs) 
    {
        $logCollection = \Yii::app()
            ->{$this->serviceName}
            ->getCollection($this->collectionName);
        
        foreach ($logs as $log) {
            
            // time
            $logCollection
                ->createDocument(array(
                    'level'         => $log[1],
                    'category'      => $log[2],
                    'logtime'       => $this->_timeToMongoDate($log[3]),
                    'message'       => $log[0],
                    'requestUri'    => isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null,
                    'userAgent'     => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null,
                ))
                ->save();
        }
    }
protected function processLogs($logs) 
    {
        $logCollection = \Yii::app()
            ->{$this->serviceName}
            ->getCollection($this->collectionName);
        
        foreach ($logs as $log) {
            
            // time
            $logCollection
                ->createDocument(array(
                    'level'         => $log[1],
                    'category'      => $log[2],
                    'logtime'       => $this->_timeToMongoDate($log[3]),
                    'message'       => $log[0],
                    'requestUri'    => isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : null,
                    'userAgent'     => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null,
                ))
                ->save();
        }
    }
protected function processLogs ( $ logs ) { $ logCollection = \ Yii :: app ( ) -> { $ this -> serviceName } -> getCollection ( $ this -> collectionName ) ; foreach ( $ logs as $ log ) { // time $ logCollection -> createDocument ( array ( 'level' => $ log [ 1 ] , 'category' => $ log [ 2 ] , 'logtime' => $ this -> _timeToMongoDate ( $ log [ 3 ] ) , 'message' => $ log [ 0 ] , 'requestUri' => isset ( $ _SERVER [ 'REQUEST_URI' ] ) ? $ _SERVER [ 'REQUEST_URI' ] : null , 'userAgent' => isset ( $ _SERVER [ 'HTTP_USER_AGENT' ] ) ? $ _SERVER [ 'HTTP_USER_AGENT' ] : null , ) ) -> save ( ) ; } }
Write log messages
@param array $logs list of messages
Write log messages