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

[Bug]: 使用modern deploy部署后,启动项目后debug日志如何关闭 #6884

Open
Luckypolo2 opened this issue Feb 25, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@Luckypolo2
Copy link

版本信息

windows device

问题详情

在生产环境使用 node .output/index 每次请求文件都有debug日志,如何去除?

复现链接

/

复现步骤

npx modern deploy
node .output/index

@Luckypolo2 Luckypolo2 added the bug Something isn't working label Feb 25, 2025
@yimingjfe
Copy link
Member

可以通过环境变量 MODERN_SERVER_LOG_LEVEL 控制日志输出的级别, 什么场景下生产环境不需要日志呢?

@Luckypolo2
Copy link
Author

@yimingjfe 是日志输出的太多, 例如,每一个人请求一次就会打印一个debug --> get /favicon.ico 200 6ms,其他类型文件也类似这样

@Luckypolo2
Copy link
Author

@yimingjfe 能请问一下MODERN_SERVER_LOG_LEVE的具体参数吗,在文档里没有找到

@lanmingle
Copy link

@yimingjfe 能请问一下MODERN_SERVER_LOG_LEVE的具体参数吗,在文档里没有找到

+1 之前还想基于node作为运行时,发现这块的环境变量没有相关的文档等等,还是老老实实用nginx部署,弃用某部分功能。

@zllkjc
Copy link
Member

zllkjc commented Feb 26, 2025

@yimingjfe 能请问一下MODERN_SERVER_LOG_LEVE的具体参数吗,在文档里没有找到

我正在补充这部分的文档,应该这两周会 PR。内置日志使用了 rslog,可以参考它的 level:https://www.npmjs.com/package/rslog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants