Skip to content

Commit 32ef010

Browse files
committed
move remote_user, remote_addr, errorid to end of log message
1 parent 0e7dde3 commit 32ef010

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

resources/lib/UnityHTTPD.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ public static function errorLog(
5252
$output["data"] = "data could not be JSON encoded: " . $e->getMessage();
5353
}
5454
}
55-
$output["REMOTE_USER"] = $_SERVER["REMOTE_USER"] ?? null;
56-
$output["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"] ?? null;
57-
if (!is_null($errorid)) {
58-
$output["errorid"] = $errorid;
59-
}
6055
if (!is_null($error)) {
6156
$output["error"] = self::throwableToArray($error);
6257
} else {
6358
// newlines are bad for error log, but getTrace() is too verbose
6459
$output["trace"] = explode("\n", (new \Exception())->getTraceAsString());
6560
}
61+
$output["REMOTE_USER"] = $_SERVER["REMOTE_USER"] ?? null;
62+
$output["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"] ?? null;
63+
if (!is_null($errorid)) {
64+
$output["errorid"] = $errorid;
65+
}
6666
error_log("$title: " . \jsonEncode($output));
6767
}
6868

0 commit comments

Comments
 (0)