Yii框架日志记录器:删除路径


Yii framework logger : Remove the path

我使用yii日志记录我的事件。这是我的日志示例

[2013-05-24 11:58:29.015965] [debug] [SiteController] this is debug test
in D:'work'www'cs360rnd'trunk'protected'controllers'SiteController.php (79)
in D:'work'www'cs360rnd'trunk'index.php (16) 

我想从log

中删除下面的行

in D:'work'www'cs360rnd'trunk'index.php (16)

有没有人知道我如何从日志布局中删除它?

这些是回溯条目。

您想要删除index.php的行吗?(1)

或者你想只留下第一个(与SiteController)?(2)

(1)和(2)如果在callstack中有两个以上的元素,则

(1)和(2)是不相同的。

https://github.com/yiisoft/yii/blob/master/framework/YiiBase.php L458参见第462行。

首先,只有当您处于调试模式时,才会使用log-message记录调试回溯。

,

如果你的目标是(1)-恐怕你需要扩展Yii类,覆盖log方法并使用它而不是内置。

如果你的目标是(2)- YII_TRACE_LEVEL应该等于1。