egg-logger 配置不起作用
- Node Version: 7.7.4
- Egg Version: 1.0.0
- Plugin Name: egg-logger
- Plugin Version:
- Platform: win 7 sp1 x64
配置不起作用,永远都只会根据默认配置,只会输出 INFO 及以上(WARN 和 ERROR)的日志到终端中。
//config.default.js exports.logger = { level: 'DEBUG', consoleLevel: 'DEBUG', };
配置到 config.local.js里
搞个最小化的可重现的例子放到 github 看看
写到config.local.js里生效了
写在config.default.js里不生效
https://github.com/eggjs/egg/blob/master/config/config.local.js#L6
这个原因导致的, @popomore
是的,@luckydrq 这都能猜到,感觉被坑过。
要干掉么
框架还是只设置 default 配置好了,local 等环境相关的都去掉
@popomore 之前用内网版本遇到过 :D
@luckydrq 难怪....... 哈哈
@luckydrq 摸头
consoleLevel: INFO两边是一样的,可以干掉- 但
level: 'INFO',如果不在 local 配置为 DEBUG 的话,在开发期会错过一些信息的。
还好很少人会去看文件的。
框架和插件应该都不要和 env 相关
egg 的 config.local.js 干掉好了,里面的内容,放到 egg-development 的 config.default.js 里面,这样用户在 app 的 config.default.js 里面就可以覆盖掉。
放 development 无法覆盖框架吧 TZ | 天猪 [email protected]于2017年3月31日 周五11:46写道:
egg 的 config.local.js 干掉好了,里面的内容,放到 egg-development 的 config.default.js 里面,这样用户在 app 的 config.default.js 里面就可以覆盖掉。
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/eggjs/egg/issues/677#issuecomment-290608338, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWA1WAdIuLxYXf94Qz935wrYjRFe-e0ks5rrHb9gaJpZM4Msits .
development 动态改?
在 app.js 动态改 config 还是调用 logger 的接口?