Home  >  Article  >  Backend Development  >  php的error_log会出现漏写的问题吗?

php的error_log会出现漏写的问题吗?

WBOY
WBOYOriginal
2016-06-06 20:52:241023browse

最近做API的日志记录,用error_log($logstr, 3, $logpath);来写。
但后来分析日志的时候,发现日志数量跟期望差很多,期望至少有20,000条,但记录看下来只有2,000左右,差了一个数量级。
有人遇到过这种情况吗?是不是error_log会漏写一些东西?

回复内容:

最近做API的日志记录,用error_log($logstr, 3, $logpath);来写。
但后来分析日志的时候,发现日志数量跟期望差很多,期望至少有20,000条,但记录看下来只有2,000左右,差了一个数量级。
有人遇到过这种情况吗?是不是error_log会漏写一些东西?

使用下面的代码也会是同样的问题吗?

file_put_contents($logpath, $logstr, FILE_APPEND);

实际的并发量大概多少?很可能是高并发情况下产生的问题。

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