Axel Amthor
Axel Amthor

Reputation: 11096

What is faster in php: syslog, file append or error_log

Are there any experiences on what is faster in php (i.e. less overhead, less time):

Thanks.

Upvotes: 1

Views: 1022

Answers (1)

hek2mgl
hek2mgl

Reputation: 157967

syslog will show differences in it's performance, depending on the configuration of the syslog daemon. For example, messages might get duplicated into several log files or even sent over the net. Therefore it is not really comparable with the others.

Using PHP's error_log() or implementing file based logging on your own shouldn't show differences in it's performance (having that you implemented it efficiently). However, I expect error_log() a bit faster since it is simple and written in C, but a custom file based implementation might be more flexible, configurable and produce better/fancier messages.

At the end you would need to benchmark and compare those solutions having a real world use case.

Upvotes: 2

Related Questions