Home > front end >  How to configure php to log to a listening socket?
How to configure php to log to a listening socket?

Time:12-18

Is it possible to configure php to send errors to a listening socket instead of sending to file?

I am speaking of Unix sockets. Not WebSockets

I am already able to code a go app to act as a listening socket. I want my app to receive php logs.

CodePudding user response:

I don't think it's possible to configure it directly. The only configuration option for where to send log messages is error_log. It can be set to either syslog or the pathname of the log file.

You could do it indirectly. The pathname could point to a named pipe, and you can have another process that reads from the named pipe and writes to the socket.

Or you could have the Go app listen on the named pipe instead of a socket.

  • Related