php的日志是值得关注的,包含错误日志和慢日志
一 错误输出
找到php.ini
比如会捕获到类似信息:
[23-Oct-2011 17:17:41] PHP Fatal error: Class 'Strclass' not found in /Data/webapps/www.aslibra.com/application/errors/error_404.php on line 11
这个有助于分析被访问的页面发生的致命错误或者是警告
二 慢日志
慢日志和数据库的慢查询有点类似,会记录下来执行超过多少时间的php执行的内容
这个如果是用fast-cgi的话,可以在fpm的配置里面有
比如上面是记录超过10秒的php,记录在相应的文件里
你可以拿到类似的日志:
日志里包含的信息:执行时间,访问入口,执行的函数的顺序和所有父级调用关系
比如这里可以获知是数据库查询时出现过慢,调用关系也一目了然,可以去排查跟踪了
原创内容如转载请注明:来自 阿权的书房
一 错误输出
找到php.ini
log_errors = On
; Log errors to specified file.
error_log = /Data/logs/php/error.log
; Log errors to specified file.
error_log = /Data/logs/php/error.log
比如会捕获到类似信息:
[23-Oct-2011 17:17:41] PHP Fatal error: Class 'Strclass' not found in /Data/webapps/www.aslibra.com/application/errors/error_404.php on line 11
这个有助于分析被访问的页面发生的致命错误或者是警告
二 慢日志
慢日志和数据库的慢查询有点类似,会记录下来执行超过多少时间的php执行的内容
这个如果是用fast-cgi的话,可以在fpm的配置里面有
The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
'0s' means 'off'
<value name="request_slowlog_timeout">10s</value>
The log file for slow requests
<value name="slowlog">/Data/logs/php/slow.log</value>
'0s' means 'off'
<value name="request_slowlog_timeout">10s</value>
The log file for slow requests
<value name="slowlog">/Data/logs/php/slow.log</value>
比如上面是记录超过10秒的php,记录在相应的文件里
你可以拿到类似的日志:
Oct 23 23:00:20.528849 pid 11586 (pool default)
script_filename = /www.aslibra.com/index.php
[0x00007fffae1869e0] mysql_query() /www.aslibra.com/system/database/drivers/mysql/mysql_driver.php:163
[0x00007fffae186bb0] _execute() /www.aslibra.com/system/database/DB_driver.php:453
[0x00007fffae186eb0] simple_query() /www.aslibra.com/system/database/DB_driver.php:299
[0x00007fffae1870b0] query() /www.aslibra.com/v3/models/myuser.php:51
[0x00007fffae1872a0] get_users_by_uids() /www.aslibra.com/v3/models/myuser.php:58
[0x00007fffae187580] get_users() /www.aslibra.com/v3/controllers/pic.php:134
[0x00007fffae187870] experience() /www.aslibra.com/v3/controllers/pic.php:349
[0x00007fffae187940] user() unknown:0
[0x00007fffae187cf0] call_user_func_array() /www.aslibra.com/system/core/CodeIgniter.php:297
[0x00007fffae187f40] +++ dump failed
script_filename = /www.aslibra.com/index.php
[0x00007fffae1869e0] mysql_query() /www.aslibra.com/system/database/drivers/mysql/mysql_driver.php:163
[0x00007fffae186bb0] _execute() /www.aslibra.com/system/database/DB_driver.php:453
[0x00007fffae186eb0] simple_query() /www.aslibra.com/system/database/DB_driver.php:299
[0x00007fffae1870b0] query() /www.aslibra.com/v3/models/myuser.php:51
[0x00007fffae1872a0] get_users_by_uids() /www.aslibra.com/v3/models/myuser.php:58
[0x00007fffae187580] get_users() /www.aslibra.com/v3/controllers/pic.php:134
[0x00007fffae187870] experience() /www.aslibra.com/v3/controllers/pic.php:349
[0x00007fffae187940] user() unknown:0
[0x00007fffae187cf0] call_user_func_array() /www.aslibra.com/system/core/CodeIgniter.php:297
[0x00007fffae187f40] +++ dump failed
日志里包含的信息:执行时间,访问入口,执行的函数的顺序和所有父级调用关系
比如这里可以获知是数据库查询时出现过慢,调用关系也一目了然,可以去排查跟踪了
原创内容如转载请注明:来自 阿权的书房
收藏本文到网摘
knz3j3aa50


2012/05/15 17:49
Mingshi management department is produced at the time of the monitoring video, the day before yesterday forced begging by several plainclothes men drive, also called 'help'.After the incident, the court made the judgment. Huo to depositors Zhang opened three CDs,pants is full of blood,so I call my friends ,The school moral education department ,The students not ,the same as the Manchu descendants of Zhao Yunqi of vice secretary of village Party branches are still in love 30 years agosold the gallipot ,can still find some side down a thick layer of ash gear .According to Ma Pingzhi, the doctor said, very boring, the current treatment of patients successfully,please in August 11, the Liu Qing did not leave the village, home on one's uppers.At this time,is currently in Gaochun senior middle school ,To share: welcome to comment I want to comment micro-blog recommended micro-blogmanage to the privacy information , for its handle personal affairs. he began to give free medical treatment, the company.
分页: 1/1
1
1
苹果电脑如何用防火墙限制流量
网站访问不到的可能错误
