This commit is contained in:
parent
19ab2a2e3d
commit
130016957d
@ -7,7 +7,7 @@ export function middleware(request: NextRequest) {
|
|||||||
const connectingIp = request.headers.get("CF-Connecting-IP") || request.ip;
|
const connectingIp = request.headers.get("CF-Connecting-IP") || request.ip;
|
||||||
|
|
||||||
// Log requests in production
|
// Log requests in production
|
||||||
if (!isProduction()) {
|
if (isProduction()) {
|
||||||
console.log(
|
console.log(
|
||||||
` ${request.method} ${request.nextUrl.pathname}${connectingIp != undefined ? ` ${connectingIp}` : ""} ${response.status} in ${(Date.now() - before).toFixed(0)}ms`
|
` ${request.method} ${request.nextUrl.pathname}${connectingIp != undefined ? ` ${connectingIp}` : ""} ${response.status} in ${(Date.now() - before).toFixed(0)}ms`
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user