Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egg-logger 配置不起作用 #677

Closed
justinli0709 opened this issue Mar 29, 2017 · 17 comments · Fixed by #695
Closed

egg-logger 配置不起作用 #677

justinli0709 opened this issue Mar 29, 2017 · 17 comments · Fixed by #695

Comments

@justinli0709
Copy link

  • 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',
};

@luckydrq
Copy link

配置到 config.local.js

@popomore
Copy link
Member

搞个最小化的可重现的例子放到 github 看看

@justinli0709
Copy link
Author

写到config.local.js里生效了

写在config.default.js里不生效

@atian25
Copy link
Member

atian25 commented Mar 29, 2017

https:/eggjs/egg/blob/master/config/config.local.js#L6

这个原因导致的, @popomore

@popomore
Copy link
Member

是的,@luckydrq 这都能猜到,感觉被坑过。

@atian25
Copy link
Member

atian25 commented Mar 29, 2017

要干掉么

@fengmk2
Copy link
Member

fengmk2 commented Mar 29, 2017

框架还是只设置 default 配置好了,local 等环境相关的都去掉

@luckydrq
Copy link

@popomore 之前用内网版本遇到过 :D

@justinli0709
Copy link
Author

@luckydrq 难怪....... 哈哈

@atian25
Copy link
Member

atian25 commented Mar 29, 2017

@luckydrq 摸头

@atian25
Copy link
Member

atian25 commented Mar 29, 2017

  • consoleLevel: INFO 两边是一样的,可以干掉
  • level: 'INFO', 如果不在 local 配置为 DEBUG 的话,在开发期会错过一些信息的。

@popomore
Copy link
Member

还好很少人会去看文件的。

@ngot
Copy link
Member

ngot commented Mar 29, 2017

框架和插件应该都不要和 env 相关

@atian25
Copy link
Member

atian25 commented Mar 31, 2017

egg 的 config.local.js 干掉好了,里面的内容,放到 egg-development 的 config.default.js 里面,这样用户在 app 的 config.default.js 里面就可以覆盖掉。

@popomore
Copy link
Member

popomore commented Mar 31, 2017 via email

@dead-horse
Copy link
Member

development 动态改?

@atian25
Copy link
Member

atian25 commented Mar 31, 2017

在 app.js 动态改 config 还是调用 logger 的接口?

@popomore popomore self-assigned this Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants