【问题标题】:Configured Log level is not working as expected配置的日志级别未按预期工作
【发布时间】:2023-01-13 14:29:35
【问题描述】:

问题:

我已按照发行说明 here 中的说明在 Config.toml 中配置了 log.level。但是,我在代码中的 log:printDebug(....) 语句没有打印调试日志。我仍然得到 INFO 和以上日志。

环境:

Ballerina 2201.3.1 (Swan Lake Update 3)
Language specification 2022R4
Update Tool 1.3.11

【问题讨论】:

    标签: ballerina


    【解决方案1】:

    需要使用以下条目来启用调试日志(与您指向的发行说明中的​​条目相比有点不同 - 需要 ballerina.log 而不仅仅是 log)。

    [ballerina.log]
    level = "DEBUG"
    

    log example 还演示了额外的配置(包括每个模块的配置)。

    另外,Config.toml 文件必须是in the current working directory if the location is not explicitly specified

    【讨论】:

    • 有人会做笔记/提出问题来更新 doco 吗?
    • 这没有用:(
    • 代码中是否还有其他配置(如configurable变量)?只是为了确保按预期选择 Config.toml 文件。或者,您可以尝试使用 BAL_CONFIG_FILES 环境变量指定路径。关于release note,鉴于这是Swan Lake Alpha3 release note,我们将检查当时的密钥是什么,如果需要更改则更新release note。
    【解决方案2】:

    您指的是已过时的 Ballerina alpha 版本“文档”,不能保证有效,但对于特定的 alpha 版本,不应再被引用。它大多只有历史价值。

    可以从以下位置找到正确的文档:

    【讨论】:

      猜你喜欢
      • 2021-03-22
      • 2018-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多