diff --git a/package.json b/package.json index 78ae4d0..e8e957d 100644 --- a/package.json +++ b/package.json @@ -46,13 +46,13 @@ "@oclif/command": "^1.5.0", "@oclif/config": "^1.7.4", "@oclif/plugin-help": "^2.1.1", + "@types/pino-http": "^4.0.2", "@types/split2": "^2.1.6", "bcrypt": "^3.0.0", "body-parser": "^1.18.3", "chalk": "^2.4.1", "cli-ux": "^4.8.1", "express": "^4.16.3", - "express-pino-logger": "^4.0.0", "express-promise-router": "^3.0.3", "globby": "^8.0.1", "jsonwebtoken": "^8.3.0", @@ -64,6 +64,7 @@ "mqtt": "^2.18.8", "pg": "^7.4.3", "pino": "^5.4.0", + "pino-http": "^4.2.0", "pump": "^3.0.0", "reflect-metadata": "^0.1.12", "serializr": "^1.3.0", diff --git a/server/express/requestLogger.ts b/server/express/requestLogger.ts index 5f69445..6366ac7 100644 --- a/server/express/requestLogger.ts +++ b/server/express/requestLogger.ts @@ -1,8 +1,7 @@ import log from "@common/logger"; -import expressPinoLogger = require("express-pino-logger"); -import * as pino from "pino"; +import pinoHttp = require("pino-http"); -const l = pino(); -pino(l); - -export default expressPinoLogger(log); +export default pinoHttp({ + logger: log, + useLevel: "debug", +} as pinoHttp.Options); diff --git a/yarn.lock b/yarn.lock index 7889297..3d56494 100644 --- a/yarn.lock +++ b/yarn.lock @@ -227,6 +227,21 @@ resolved "https://registry.yarnpkg.com/@types/object-assign/-/object-assign-4.0.30.tgz#8949371d5a99f4381ee0f1df0a9b7a187e07e652" integrity sha1-iUk3HVqZ9Dge4PHfCpt6GH4H5lI= +"@types/pino-http@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/pino-http/-/pino-http-4.0.2.tgz#e01994d1eb0cf5261b14048c11575b4cff382509" + integrity sha512-746TwLXL52SEg6sdjkOaAIKeOsaZFoE7N3MThvXr8SXrRfIcUdQW7XhtMqw1C710zlcxlS8+XrobvLx3gdov1g== + dependencies: + "@types/pino" "*" + +"@types/pino@*": + version "5.8.8" + resolved "https://registry.yarnpkg.com/@types/pino/-/pino-5.8.8.tgz#930eb30f1f1eb76b97792647477aab59e5852574" + integrity sha512-SxAdLtEpPkVUdnI3iCUjyFC7WVLFiebyzqypvkuJVo7dyK6BPuQ4lTOuZRKpbEdgG386l5HgfqpymL3oWLOUXg== + dependencies: + "@types/node" "*" + "@types/sonic-boom" "*" + "@types/pino@^5.20.0": version "5.20.0" resolved "https://registry.yarnpkg.com/@types/pino/-/pino-5.20.0.tgz#d4bafa71d992d223d29c857c11988e8c3abc66f0" @@ -312,6 +327,13 @@ "@types/express-serve-static-core" "*" "@types/mime" "*" +"@types/sonic-boom@*": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@types/sonic-boom/-/sonic-boom-0.6.2.tgz#5f6c7bf6b4a0994f9339d778da6a7adcc3d37080" + integrity sha512-vP9Sn1tuz/BTh8L1o776Cbzr+WH4dZGmRXOjQ5L+IVQx40hUmvOS2wfIkqUsID1vL62tThWdlXWIqijwewu3mw== + dependencies: + "@types/node" "*" + "@types/split2@^2.1.6": version "2.1.6" resolved "https://registry.yarnpkg.com/@types/split2/-/split2-2.1.6.tgz#b095c9e064853824b22c67993d99b066777402b1" @@ -2683,13 +2705,6 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -express-pino-logger@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/express-pino-logger/-/express-pino-logger-4.0.0.tgz#775cf253a4e0e7ee2c24804f8a32900d6d0168ca" - integrity sha512-BTJwjQXMSR6tFiyvTOOr6aosJkJOuJpW0mXE+icv3ae/0WXBGnLaumINGHJvWMuDO1RSLHBLfRrJaghMjMhVrg== - dependencies: - pino-http "^4.0.0" - express-promise-router@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/express-promise-router/-/express-promise-router-3.0.3.tgz#5e6d22a5a3f013d71833172fe8d7ab780c3f6b70" @@ -6060,19 +6075,24 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pino-http@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/pino-http/-/pino-http-4.1.0.tgz#e2dca663712d1e437311be2d5796c76736744cfe" - integrity sha512-IRmQMLFK2M/N05T+yitm7IL1duTjs5YlsfVCV6Pm5akFl6mIbr/fx9K2F4JZtEiwRFfyGb1A9MRJ/YhKd+3TUw== +pino-http@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pino-http/-/pino-http-4.2.0.tgz#a2d2e2bca7d0ed17f6dd414952f15ff4dea7efab" + integrity sha512-yLOpH8fwnUJ3n++QmjS9HtxooJN8OKKcbbW+deRh7GqNHyY5+M9ehmH1X69pY+vuCxBY6hKGJGO2wmHG6OEmDQ== dependencies: pino "^5.0.0" - pino-std-serializers "^2.1.0" + pino-std-serializers "^2.4.0" -pino-std-serializers@^2.1.0, pino-std-serializers@^2.3.0: +pino-std-serializers@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-2.3.0.tgz#34eeaab97c055c28e22c0542ae55978e7e427786" integrity sha512-klfGoOsP6sJH7ON796G4xoUSx2fkpFgKHO4YVVO2zmz31jR+etzc/QzGJILaOIiCD6HTCFgkPx+XN8nk+ruqPw== +pino-std-serializers@^2.4.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-2.4.2.tgz#cb5e3e58c358b26f88969d7e619ae54bdfcc1ae1" + integrity sha512-WaL504dO8eGs+vrK+j4BuQQq6GLKeCCcHaMB2ItygzVURcL1CycwNEUHTD/lHFHs/NL5qAz2UKrjYWXKSf4aMQ== + pino@^5.0.0, pino@^5.4.0: version "5.11.1" resolved "https://registry.yarnpkg.com/pino/-/pino-5.11.1.tgz#2d6d8edb7ebc7c354be03bfa04fd436352e1d67b"