Fix logs (#452)
* Add pino and pino-pretty to every package, to fix logger failing * Fix taxes child logger * Fix Search child logger * Update examples .env * changeset
This commit is contained in:
parent
ccd8250e2f
commit
8b22b1c1f8
24 changed files with 154 additions and 33 deletions
15
.changeset/sour-dingos-roll.md
Normal file
15
.changeset/sour-dingos-roll.md
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
"saleor-app-emails-and-messages": patch
|
||||
"saleor-app-data-importer": patch
|
||||
"saleor-app-products-feed": patch
|
||||
"saleor-app-monitoring": patch
|
||||
"saleor-app-invoices": patch
|
||||
"saleor-app-klaviyo": patch
|
||||
"saleor-app-search": patch
|
||||
"saleor-app-slack": patch
|
||||
"saleor-app-taxes": patch
|
||||
"saleor-app-cms": patch
|
||||
"saleor-app-crm": patch
|
||||
---
|
||||
|
||||
Restored Pino logger packages to each app, to fix failing logs in development. Also updated .env.example to contain up to date APP_LOG_LEVEL variable
|
|
@ -30,6 +30,8 @@
|
|||
"graphql": "^16.6.0",
|
||||
"graphql-tag": "^2.12.6",
|
||||
"next": "13.3.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.39.1",
|
||||
|
|
|
@ -9,4 +9,4 @@ REST_APL_TOKEN=
|
|||
MAILCHIMP_CLIENT_ID=
|
||||
MAILCHIMP_CLIENT_SECRET=
|
||||
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_LOG_LEVEL=info
|
|
@ -33,6 +33,8 @@
|
|||
"jsdom": "^20.0.3",
|
||||
"next": "13.3.0",
|
||||
"next-urql": "^4.0.2",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.43.0",
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# https://getnuvo.com/
|
||||
NEXT_PUBLIC_NUVO_LICENSE_KEY=
|
||||
NEXT_PUBLIC_NUVO_PROD_MODE=false
|
||||
|
||||
APP_LOG_LEVEL=info
|
|
@ -34,6 +34,8 @@
|
|||
"jsdom": "^20.0.3",
|
||||
"next": "13.3.0",
|
||||
"nuvo-react": "^1.22.1",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"urql": "^3.0.3",
|
||||
|
|
|
@ -7,3 +7,4 @@ APL=
|
|||
REST_APL_ENDPOINT=
|
||||
REST_APL_TOKEN=
|
||||
|
||||
APP_LOG_LEVEL=info
|
|
@ -42,6 +42,8 @@
|
|||
"next": "13.3.0",
|
||||
"next-urql": "^4.0.3",
|
||||
"nodemailer": "^6.9.1",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.43.0",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# https://vercel.com/guides/how-can-i-use-files-in-serverless-functions
|
||||
TEMP_PDF_STORAGE_DIR=
|
||||
#"fatal" | "error" | "warn" | "info" | "debug" | "trace"
|
||||
APP_DEBUG=info
|
||||
APP_LOG_LEVEL=info
|
||||
# Optional
|
||||
# Regex pattern consumed conditionally to restrcit app installation to specific urls.
|
||||
# See api/register.tsx
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
"schemaVersion": "3.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hookform/resolvers": "^3.1.0",
|
||||
"@saleor/app-sdk": "0.37.3",
|
||||
"@saleor/apps-shared": "workspace:*",
|
||||
"@saleor/macaw-ui": "^0.8.0-pre.80",
|
||||
|
@ -34,6 +35,8 @@
|
|||
"graphql-tag": "^2.12.6",
|
||||
"microinvoice": "^1.0.6",
|
||||
"next": "13.3.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.41.0",
|
||||
|
@ -41,8 +44,7 @@
|
|||
"tiny-invariant": "^1.3.1",
|
||||
"urql": "^3.0.3",
|
||||
"usehooks-ts": "^2.9.1",
|
||||
"zod": "^3.20.2",
|
||||
"@hookform/resolvers": "^3.1.0"
|
||||
"zod": "^3.20.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/cli": "3.2.2",
|
||||
|
|
|
@ -7,3 +7,5 @@ APL=file
|
|||
ALLOWED_DOMAIN_PATTERN=
|
||||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
|
@ -28,6 +28,8 @@
|
|||
"graphql-tag": "^2.12.6",
|
||||
"next": "13.3.0",
|
||||
"node-fetch": "^3.2.6",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
"graphql-tag": "^2.12.6",
|
||||
"jsdom": "^20.0.3",
|
||||
"next": "13.3.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.42.1",
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
"jsdom": "^20.0.3",
|
||||
"next": "13.3.0",
|
||||
"next-urql": "^4.0.2",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.43.0",
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
|
@ -30,6 +30,8 @@
|
|||
"graphql-tag": "^2.12.6",
|
||||
"next": "13.3.0",
|
||||
"next-urql": "4.0.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
|
@ -56,10 +58,10 @@
|
|||
"eslint-config-next": "13.0.2",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-config-saleor": "workspace:*",
|
||||
"node-mocks-http": "^1.12.2",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "4.8.4",
|
||||
"vite": "^4.3.1",
|
||||
"vitest": "^0.30.1",
|
||||
"node-mocks-http": "^1.12.2"
|
||||
"vitest": "^0.30.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,11 @@ import { createLogger as _createLogger } from "@saleor/apps-shared";
|
|||
/**
|
||||
* Extend factory to add more settings specific for the app
|
||||
*/
|
||||
export const logger = _createLogger({
|
||||
redact: ["token", "secretKey"],
|
||||
});
|
||||
export const logger = _createLogger(
|
||||
{},
|
||||
{
|
||||
redact: ["token", "secretKey"],
|
||||
}
|
||||
);
|
||||
|
||||
export const createLogger = logger.child.bind(logger);
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
# Encryption key used by the EncryptedSettingsManager. Required by the production builds
|
||||
SECRET_KEY=
|
||||
|
||||
APP_LOG_LEVEL=info
|
|
@ -28,6 +28,8 @@
|
|||
"graphql-tag": "^2.12.6",
|
||||
"jose": "^4.11.2",
|
||||
"next": "13.3.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
APL=file
|
||||
|
||||
#"fatal" | "error" | "warn" | "info" | "debug" | "trace"
|
||||
APL=
|
||||
APP_DEBUG=info
|
||||
APP_LOG_LEVEL=info
|
||||
NODE_ENV=
|
||||
SECRET_KEY=
|
||||
PORT=
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
"jotai": "^2.0.0",
|
||||
"jsdom": "^20.0.3",
|
||||
"next": "13.3.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.42.1",
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
import { createLogger as _createLogger, Logger } from "@saleor/apps-shared";
|
||||
import { Logger, logger as _logger } from "@saleor/apps-shared";
|
||||
|
||||
export const logger = _createLogger({
|
||||
redact: [
|
||||
"metadata",
|
||||
"providerInstance.config.username",
|
||||
"providerInstance.config.password",
|
||||
"providerInstance.config.apiKey",
|
||||
],
|
||||
});
|
||||
export const logger = _logger.child(
|
||||
{},
|
||||
{
|
||||
redact: [
|
||||
"metadata",
|
||||
"providerInstance.config.username",
|
||||
"providerInstance.config.password",
|
||||
"providerInstance.config.apiKey",
|
||||
],
|
||||
}
|
||||
);
|
||||
|
||||
export const createLogger = logger.child.bind(logger);
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"name": "@saleor/apps-shared",
|
||||
"version": "1.5.0",
|
||||
"dependencies": {
|
||||
"pino": "^8.8.0",
|
||||
"pino-pretty": "^9.1.1"
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@material-ui/core": "^4.12.4",
|
||||
|
@ -21,6 +21,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"next": "^13.3.0",
|
||||
"pino": "^8.14.1",
|
||||
"pino-pretty": "^10.0.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
|
|
|
@ -73,6 +73,12 @@ importers:
|
|||
next:
|
||||
specifier: 13.3.0
|
||||
version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -218,6 +224,12 @@ importers:
|
|||
next-urql:
|
||||
specifier: ^4.0.2
|
||||
version: 4.0.3(react@18.2.0)(urql@3.0.3)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -363,6 +375,12 @@ importers:
|
|||
nuvo-react:
|
||||
specifier: ^1.22.1
|
||||
version: 1.22.1(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -523,6 +541,12 @@ importers:
|
|||
nodemailer:
|
||||
specifier: ^6.9.1
|
||||
version: 6.9.1
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -680,6 +704,12 @@ importers:
|
|||
next:
|
||||
specifier: 13.3.0
|
||||
version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -816,6 +846,12 @@ importers:
|
|||
node-fetch:
|
||||
specifier: ^3.2.6
|
||||
version: 3.3.0
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -940,6 +976,12 @@ importers:
|
|||
next:
|
||||
specifier: 13.3.0
|
||||
version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -1085,6 +1127,12 @@ importers:
|
|||
next-urql:
|
||||
specifier: ^4.0.2
|
||||
version: 4.0.3(react@18.2.0)(urql@3.0.3)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -1218,6 +1266,12 @@ importers:
|
|||
next-urql:
|
||||
specifier: 4.0.0
|
||||
version: 4.0.0(react@18.2.0)(urql@3.0.3)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -1348,6 +1402,12 @@ importers:
|
|||
next:
|
||||
specifier: 13.3.0
|
||||
version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -1499,6 +1559,12 @@ importers:
|
|||
next:
|
||||
specifier: 13.3.0
|
||||
version: 13.3.0(@babel/core@7.21.4)(react-dom@18.2.0)(react@18.2.0)
|
||||
pino:
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
react:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0
|
||||
|
@ -1622,11 +1688,11 @@ importers:
|
|||
packages/shared:
|
||||
dependencies:
|
||||
pino:
|
||||
specifier: ^8.8.0
|
||||
version: 8.9.0
|
||||
specifier: ^8.14.1
|
||||
version: 8.14.1
|
||||
pino-pretty:
|
||||
specifier: ^9.1.1
|
||||
version: 9.1.1
|
||||
specifier: ^10.0.0
|
||||
version: 10.0.0
|
||||
devDependencies:
|
||||
'@material-ui/core':
|
||||
specifier: ^4.12.4
|
||||
|
@ -14042,8 +14108,8 @@ packages:
|
|||
split2: 4.1.0
|
||||
dev: false
|
||||
|
||||
/pino-pretty@9.1.1:
|
||||
resolution: {integrity: sha512-iJrnjgR4FWQIXZkUF48oNgoRI9BpyMhaEmihonHeCnZ6F50ZHAS4YGfGBT/ZVNsPmd+hzkIPGzjKdY08+/yAXw==}
|
||||
/pino-pretty@10.0.0:
|
||||
resolution: {integrity: sha512-zKFjYXBzLaLTEAN1ayKpHXtL5UeRQC7R3lvhKe7fWs7hIVEjKGG/qIXwQt9HmeUp71ogUd/YcW+LmMwRp4KT6Q==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
colorette: 2.0.19
|
||||
|
@ -14066,8 +14132,8 @@ packages:
|
|||
resolution: {integrity: sha512-KO0m2f1HkrPe9S0ldjx7za9BJjeHqBku5Ch8JyxETxT8dEFGz1PwgrHaOQupVYitpzbFSYm7nnljxD8dik2c+g==}
|
||||
dev: false
|
||||
|
||||
/pino@8.9.0:
|
||||
resolution: {integrity: sha512-/x9qSrFW4wh+7OL5bLIbfl06aK/8yCSIldhD3VmVGiVYWSdFFpXvJh/4xWKENs+DhG1VkJnnpWxMF6fZ2zGXeg==}
|
||||
/pino@8.14.1:
|
||||
resolution: {integrity: sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
atomic-sleep: 1.0.0
|
||||
|
|
Loading…
Reference in a new issue