Вопрос

At which point (and why?) my logged message:

Test Message

is turned into:

Test Message
in C:\XAMPP\path\protected\controllers\SiteController.php (107)
in C:\XAMPP\path\htdocs\index.php (42)

when it is logged by Yii's any kind of log route?

How to get rid of this addition or how to log only what, I really want to log? Is there a switch/flag in log route configuration to handle this or do I have to overwrite processLogs() or even entire CLogger class?

I tried to read about CLogFilter, but it seems to be unrelated. It has options only for adding user, session and variables to logged message. I don't see anything about adding path to file, where logging operation occurred.

Это было полезно?

Решение

If you have YII_TRACE_LEVEL constant defined in your entry script you need to remove it.

Here is what found: http://www.yiiframework.com/doc/guide/1.1/en/topics.logging

Quote:

Yii supports logging call stack information in the messages that are logged by calling Yii::trace. This feature is disabled by default because it lowers performance. To use this feature, simply define a constant named YII_TRACE_LEVEL at the beginning of the entry script (before including yii.php) to be an integer greater than 0. Yii will then append to every trace message with the file name and line number of the call stacks belonging to application code. The number YII_TRACE_LEVEL determines how many layers of each call stack should be recorded. This information is particularly useful during development stage as it can help us identify the places that trigger the trace messages.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top