Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Winstonロガーを作成しました。
_logger.add(logger.transports.File, { filename: conf_fileName, timestamp:'true', maxsize: 1024, maxFiles: 2 });
しかし、数時間後には、サイズが ~2kb のファイルがたくさんあります。ロガーの定義に何か問題がありますか?
はmaxsizeバイト単位です - したがって、ログファイルを 1KB に制限しています (OS によって 2KB と報告される場合があります)。
maxsize
1MBが必要な場合は、試してくださいmaxsize: 1048576
maxsize: 1048576
と の両方が設定されている場合に、設定が反映されないという問題がありmaxFilesます。maxsizemaxFiles
maxFiles
課題トラッカーでこの課題を参照してください