在 cmdline 上设置 java.lang.System.Logger 的日志级别

发布于 2025-01-13 09:02:12 字数 113 浏览 7 评论 0原文

有没有办法在命令行上设置 java.lang.System.Logger 的日志记录级别?使用烘焙到 JAR 中的属性文件是不行的,因为我希望在暂存和生产环境中使用相同的 JAR,但暂存环境具有更详细的日志记录。

Is there a way to set the logging level for the java.lang.System.Logger on the command line? Using properties files baked into the JAR is a no-go, since I want to have the same JAR in staging and production environments with the difference that the staging environment has more verbose logging.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕嗳→ 2025-01-20 09:02:12

java.lang.System.Logger 的每个实现的工作方式都不同,因此没有统一的方法来为所有实现设置它。

如果您碰巧使用SimpleConsoleLogger,则可以设置环境变量jdk.system.logger.level

Each implementation of java.lang.System.Logger works differently, so there's no uniform way to set it for all implementations.

If you happen to use SimpleConsoleLogger, you can set the environment variable jdk.system.logger.level.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文