add http logging
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"http-terminator": "^3.0.4",
|
"http-terminator": "^3.0.4",
|
||||||
"pino": "^7.6.2",
|
"pino": "^7.6.2",
|
||||||
"pino-colada": "^2.2.2",
|
"pino-colada": "^2.2.2",
|
||||||
|
"pino-http": "^6.5.0",
|
||||||
"pino-pretty": "^7.3.0",
|
"pino-pretty": "^7.3.0",
|
||||||
"reacord": "workspace:*",
|
"reacord": "workspace:*",
|
||||||
"react": "^18.0.0-rc.0",
|
"react": "^18.0.0-rc.0",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import compression from "compression"
|
|||||||
import express from "express"
|
import express from "express"
|
||||||
import httpTerminator from "http-terminator"
|
import httpTerminator from "http-terminator"
|
||||||
import pino from "pino"
|
import pino from "pino"
|
||||||
|
import pinoHttp from "pino-http"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import { sendJsx } from "./helpers/send-jsx"
|
import { sendJsx } from "./helpers/send-jsx"
|
||||||
import { serveFile } from "./helpers/serve-file"
|
import { serveFile } from "./helpers/serve-file"
|
||||||
@@ -12,6 +13,7 @@ const logger = pino()
|
|||||||
const port = process.env.PORT || 3000
|
const port = process.env.PORT || 3000
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
|
.use(pinoHttp({ logger }))
|
||||||
.use(compression())
|
.use(compression())
|
||||||
.get("/tailwind.css", serveTailwindCss())
|
.get("/tailwind.css", serveTailwindCss())
|
||||||
|
|
||||||
|
|||||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
@@ -143,6 +143,7 @@ importers:
|
|||||||
npm-run-all: ^4.1.5
|
npm-run-all: ^4.1.5
|
||||||
pino: ^7.6.2
|
pino: ^7.6.2
|
||||||
pino-colada: ^2.2.2
|
pino-colada: ^2.2.2
|
||||||
|
pino-http: ^6.5.0
|
||||||
pino-pretty: ^7.3.0
|
pino-pretty: ^7.3.0
|
||||||
polka: ^0.5.2
|
polka: ^0.5.2
|
||||||
postcss: ^8.4.5
|
postcss: ^8.4.5
|
||||||
@@ -180,6 +181,7 @@ importers:
|
|||||||
http-terminator: 3.0.4
|
http-terminator: 3.0.4
|
||||||
pino: 7.6.2
|
pino: 7.6.2
|
||||||
pino-colada: 2.2.2
|
pino-colada: 2.2.2
|
||||||
|
pino-http: 6.5.0
|
||||||
pino-pretty: 7.3.0
|
pino-pretty: 7.3.0
|
||||||
reacord: link:../reacord
|
reacord: link:../reacord
|
||||||
react: 18.0.0-rc.0
|
react: 18.0.0-rc.0
|
||||||
@@ -4599,6 +4601,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
|
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/fast-url-parser/1.1.3:
|
||||||
|
resolution: {integrity: sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=}
|
||||||
|
dependencies:
|
||||||
|
punycode: 1.4.1
|
||||||
|
dev: false
|
||||||
|
|
||||||
/fastq/1.13.0:
|
/fastq/1.13.0:
|
||||||
resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==}
|
resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -4844,7 +4852,6 @@ packages:
|
|||||||
/get-caller-file/2.0.5:
|
/get-caller-file/2.0.5:
|
||||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||||
engines: {node: 6.* || 8.* || >= 10.*}
|
engines: {node: 6.* || 8.* || >= 10.*}
|
||||||
dev: true
|
|
||||||
|
|
||||||
/get-intrinsic/1.1.1:
|
/get-intrinsic/1.1.1:
|
||||||
resolution: {integrity: sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==}
|
resolution: {integrity: sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==}
|
||||||
@@ -8153,6 +8160,15 @@ packages:
|
|||||||
split2: 3.2.2
|
split2: 3.2.2
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/pino-http/6.5.0:
|
||||||
|
resolution: {integrity: sha512-kIge9LCb5RvwyfWWVTBfQqU5kdwsh5ahDQ7ojbePujR4bctD5zeLPnGeS0Qpk14ZgobsmoQRzdU5/30Ny9LjWA==}
|
||||||
|
dependencies:
|
||||||
|
fast-url-parser: 1.1.3
|
||||||
|
get-caller-file: 2.0.5
|
||||||
|
pino: 7.6.2
|
||||||
|
pino-std-serializers: 5.0.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
/pino-pretty/7.3.0:
|
/pino-pretty/7.3.0:
|
||||||
resolution: {integrity: sha512-HAhShJ2z2QzxXhYAn6XfwYpF13o1PQbjzSNA9q+30FAvhjOmeACit9lprhV/mCOw/8YFWSyyNk0YCq2EDYGYpw==}
|
resolution: {integrity: sha512-HAhShJ2z2QzxXhYAn6XfwYpF13o1PQbjzSNA9q+30FAvhjOmeACit9lprhV/mCOw/8YFWSyyNk0YCq2EDYGYpw==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -8175,6 +8191,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==}
|
resolution: {integrity: sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/pino-std-serializers/5.0.0:
|
||||||
|
resolution: {integrity: sha512-YC5Lv+nNxY51oicb/t8VX/sA3dnecCXeQ7heir+H+c4fbg3LD65NFdrfP3Y2ufR0Y/EYbEs5UDxHIB9NwCmYyQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/pino/7.6.2:
|
/pino/7.6.2:
|
||||||
resolution: {integrity: sha512-GTzW+HHOzUTaPIyvK6tasky2jMXF1o3iw7Oc2ik7qFjcaexXfyn6ej72XwX4O+wuRyFCbp3oKpv00htrPddv5A==}
|
resolution: {integrity: sha512-GTzW+HHOzUTaPIyvK6tasky2jMXF1o3iw7Oc2ik7qFjcaexXfyn6ej72XwX4O+wuRyFCbp3oKpv00htrPddv5A==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -8423,6 +8443,10 @@ packages:
|
|||||||
end-of-stream: 1.4.4
|
end-of-stream: 1.4.4
|
||||||
once: 1.4.0
|
once: 1.4.0
|
||||||
|
|
||||||
|
/punycode/1.4.1:
|
||||||
|
resolution: {integrity: sha1-wNWmOycYgArY4esPpSachN1BhF4=}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/punycode/2.1.1:
|
/punycode/2.1.1:
|
||||||
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
|
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|||||||
Reference in New Issue
Block a user