From 612423fe6b8aae8981c997461c13113dead9d7ab Mon Sep 17 00:00:00 2001 From: Pierre Wizla Date: Thu, 21 Sep 2023 15:45:43 +0200 Subject: [PATCH] Fix code example for Winston logger --- .../dev-docs/configurations/middlewares.md | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/docusaurus/docs/dev-docs/configurations/middlewares.md b/docusaurus/docs/dev-docs/configurations/middlewares.md index 8516a3a519..176251c1bb 100644 --- a/docusaurus/docs/dev-docs/configurations/middlewares.md +++ b/docusaurus/docs/dev-docs/configurations/middlewares.md @@ -509,18 +509,21 @@ module.exports = [ 'use strict'; -import { winston, formats: { prettyPrint, levelFilter }} from '@strapi/logger'; +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' }) - ), - }), - ], + { + transports: [ + new winston.transports.Console({ + level: 'http', + format: winston.format.combine( + levelFilter('http'), + prettyPrint({ timestamps: 'YYYY-MM-DD hh:mm:ss.SSS' }) + ), + }), + ], + }, ]; ```