From e61f1460335b6b57d59f000c40c0d8f67a6084f8 Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Wed, 29 Nov 2023 18:07:48 +0100 Subject: [PATCH] Fix logger code example --- .../dev-docs/configurations/middlewares.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/docusaurus/docs/dev-docs/configurations/middlewares.md b/docusaurus/docs/dev-docs/configurations/middlewares.md index e2c89c9679..32889c93b7 100644 --- a/docusaurus/docs/dev-docs/configurations/middlewares.md +++ b/docusaurus/docs/dev-docs/configurations/middlewares.md @@ -488,7 +488,7 @@ const { formats: { prettyPrint, levelFilter }, } = require('@strapi/logger'); -module.exports = [ +module.exports = { transports: [ new winston.transports.Console({ level: 'http', @@ -498,7 +498,7 @@ module.exports = [ ), }), ], -]; +}; ``` @@ -512,19 +512,17 @@ module.exports = [ import winston from 'winston'; import { prettyPrint, levelFilter } from 'winston.format'; -export default [ - { - transports: [ - new winston.transports.Console({ - level: 'http', - format: winston.format.combine( - levelFilter('http'), - prettyPrint({ timestamps: 'YYYY-MM-DD hh:mm:ss.SSS' }) - ), - }), - ], - }, -]; +export default { + transports: [ + new winston.transports.Console({ + level: 'http', + format: winston.format.combine( + levelFilter('http'), + prettyPrint({ timestamps: 'YYYY-MM-DD hh:mm:ss.SSS' }) + ), + }), + ], +}; ```