I'm wanting to switch to mpm_event to be able to serve a higher rate of requests. My initial testing showed that the server can serve a higher rate of requests when using mpm event. The server is basically just serving files, but there is a php application running on the server. I've been using prefork up until now. The php application uses the apache_note() function to insert some information into the apache logs. When I run mpm_event, this functionality seems to break (function not found). Is mpm_event compatible with apache_note(), or should I use some other method to insert data into the logs?
1 Answer
Certain functions, like apache_note(), are only available when PHP runs as an Apache module. Using this, or anything specific to mod_php, is usually a bad idea due to lock-in. Consider using a standard function like trigger_error() instead. It was specifically designed for what you want to do, unlike apache_note().
-  Is there a function that can be used to insert general information into the logs? My use case is that I grab the username from the request and add it into the log.yossarian2004– yossarian20042018-10-02 16:00:45 +00:00Commented Oct 2, 2018 at 16:00
-  I think maybe just using headers would accomplish the same task?yossarian2004– yossarian20042018-10-02 21:26:15 +00:00Commented Oct 2, 2018 at 21:26
-  Apache has a very rich log format. Depending on the design of your application, it may be able to log your desired data alone without any help from PHP.Michael Hampton– Michael Hampton2018-10-03 03:37:07 +00:00Commented Oct 3, 2018 at 3:37
-  Issue is that I decrypt a cookie to pull the userid out. This is done with PHP and then added to the logs.yossarian2004– yossarian20042018-10-04 16:29:11 +00:00Commented Oct 4, 2018 at 16:29
-  @yossarian2004 You probably should be keeping your own logs. Sticking this stuff in the Apache log is kind of messy.Michael Hampton– Michael Hampton2018-10-04 18:52:33 +00:00Commented Oct 4, 2018 at 18:52
