You are viewing revision #2 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.
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
For other Yii & Heroku how-to's, check my blog at http://aaronfrancis.com/blog/?tag=Yii
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.