Add IP address to request state on error logs

Jake B.

Well-known member
See title

Diff:
diff --git a/src/XF/Error.php b/src/XF/Error.php
index 3c2544b77..7a6be5402 100644
--- a/src/XF/Error.php
+++ b/src/XF/Error.php
@@ -335,6 +335,7 @@ class Error
        $request = $this->app->request();
 
        return [
+           'ip' => $request->getIp(),
            'url' => $request->getRequestUri(),
            'referrer' => $request->getReferrer(),
            '_GET' => $_GET,
 
Upvote 5

digitalpoint

Well-known member
That reminds me, it would be really nice to also know the server that the error happened on (for those in a situation where you are using a cluster of multiple servers).

PHP:
'host' => gethostname(),
 
Top