2

I want to combine the output written to the civicrm log file and php_error.log. This is because I cannot alway conclude based on the time stamp what the order is of the messages in those files. Ideally, I would have them in a single file so that the 'whole story' is in one place.

Is this possible? Ideally, I could catch the warnings that are sent to php_errorlog and write them with the same routine as I use for writing to the logging.

2

I can think of a way to do it the other way around, by defining your own civicrm logger and having it send to syslog. The problem is large stacktraces might get cut off and be formatted badly because of the way that works.

To get php to send all its errors including 500-level errors to civi might not even be possible, because they happen before civi even gets to the point where it would be capable of writing a log. If civi can't even load because of error 500, it can't possibly write to its own log.

Or if the error were to be in the CMS, then it might not be able to get to civi either.

| improve this answer | |
1

If you can't correlate the events in order, are you logging from different machines?

Event correlation is a rabbit hole and there are a lot of great products (free and not free to do it) however, you should start by looking at your logging environment (which it sounds like you are).

If you are using stock syslog, I recommend moving to syslog-ng. NG was designed to better acocmodate event correlation and is way better for diagnostics.

Here is a link to an article on event correlation with NG but you should start by finding a good howto for installing NG on your distribution.

https://lwn.net/Articles/424459/

Good luck,

Karl

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.