Quantcast
Channel: Live News for Yii Framework
Viewing all articles
Browse latest Browse all 3376

[Wiki] Logging to Heroku's logs from Yii

$
0
0

In order to get your Yii logs into Heroku's logs, you have to work a little bit of magic. You'll need to modify the boot.sh script and add the following two lines:

touch /app/apache/logs/app_log
tail -F /app/apache/logs/app_log &

This will set up the log and tail it so that when you request "heroku logs", this log is included.

Then, your component looks like this:

class CHerokuLogRoute extends CLogRoute
{
    public function processLogs($logs)
    {
        $STDOUT = fopen("/app/apache/logs/app_log", "a");
        foreach($logs as $log) 
            fwrite($STDOUT, $log[0]);
        fclose($STDOUT);
    }
}

Any questions or issues, please refer to the github page at https://github.com/aarondfrancis/yii-CHerokuLogRoute


Viewing all articles
Browse latest Browse all 3376

Trending Articles