eggjs / eggjs/egg

关于自定义logger在生产环境下无法写日志文件的问题

Open
#4,959 5 comments 0 reactions 0 assignees View on GitHub
Inactive
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

需要使用自定义日志,记录一些特定的数据

// config
1,自定义日志 config.customerLogger
myLogger
2,log level级别为INFO
config.logger
level : 'INFO'

// controller
1,使用 ctx.getLogger('myLogger').info('my info')

----------------------
// 问题
1,npm run dev
可以正常写到自定义日志文件中

2,npm start
不会写到自定义日志文件中

是我的配置或用法有什么问题吗? 请多指教!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.