sasori
sasori

Reputation: 5455

how to call the logPath defined in the main.php of yii?

how to get the logPath defined in the main.php of the config in yii? I tried ,

CFileLogRoute::getLogPath();

doesn't work, lol, I don't know how to call it properly to output the value of it

Upvotes: 2

Views: 365

Answers (1)

Michael Härtl
Michael Härtl

Reputation: 8597

Not sure why you would need that path, but here it goes:

foreach(Yii::app()->log->routes as $route) {
    if($route instanceof CFileLogRoute) {
        echo "logPath: ".$route->logPath;
    }
}

Upvotes: 3

Related Questions