简体   繁体   中英

Can writing to log files cause write conflicts?

I have a web server that host several PHP applications and I want to know if its possible to encounter a write conflict under heavy normal/traffic when writing log details to a text file. In my case all applications using the same log file. If the possibility is high please give advises on how it could be reduced or avoided.

If you going to down vote, give reasons.

To avoid any issues you need to lock the file so only one application at a time is writing to the file. With no exceptions - you need to have a lock.

If you have really loaded application(s) - you could choose some non-blocking logging daemon or storage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM