Home >Backend Development >PHP Tutorial >yii2 custom program access log

yii2 custom program access log

WBOY
WBOYOriginal
2016-07-06 13:51:431359browse

Question

The project is developed using yii2 and needs to record all accessed access_log custom formats. Now we are encountering the following problems

  1. Don’t know where to write a log?

  2. I don’t know how to dynamically obtain the accessed controller action

Reply content:

Question

The project is developed using yii2 and needs to record all accessed access_log custom formats. Now we are encountering the following problems

  1. Don’t know where to write a log?

  2. I don’t know how to dynamically obtain the accessed controller action

  1. If it is not very complicated, you can directly use nginx’s access_log

  2. You can print Yii::$app to see that both `controller and action

  3. are used in the current request.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn