开发者社区 > 云原生 > 正文

Nacos sts 的 yaml 里面可以设置日志级别么?

Nacos sts 的 yaml 里面可以设置日志级别么? 比如开启 debug 日志这种:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilterRegistration' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authFilter' defined in class path resource [com/alibaba/nacos/core/auth/AuthConfig.class]: Unsatisfied dependency expressed through method 'authFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authConfigs': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'NACOS_AUTH_IDENTITY_KEY' in value "${NACOS_AUTH_IDENTITY_KEY}"

展开
收起
-Feng、冯冯 2023-10-11 07:46:12 75 0
2 条回答
写回答
取消 提交回答
  • Nacos STS 的 YAML 文件中可以设置日志级别。Nacos STS 使用 Logback 作为日志框架,你可以通过在 YAML 文件中配置 Logback 的日志级别来控制日志的输出。
    Nacos STS 的 YAML 文件中,你可以使用 logging.level 配置项来设置日志级别。例如,你可以添加以下配置项来开启 debug 日志:

    • logging.level.org.springframework.boot: debug

    这将会把 Spring Boot 框架的 debug 日志级别设置为 debug。此外,你还可以添加其他配置项来设置其他日志级别的级别。例如,你可以添加以下配置项来设置 log4j2 的日志级别:

    • logging.level.log4j2: debug

    这将会把 log4j2 的 debug 日志级别设置为 debug
    总的来说,Nacos STS 的 YAML 文件中可以设置日志级别。你可以使用 logging.level 配置项来设置日志级别。如果你需要开启 debug 日志,你可以添加 logging.level.org.springframework.boot: debug 配置项。

    2023-10-20 10:57:56
    赞同 展开评论 打赏
  • info:只记录重要的信息,如系统启动和关闭、错误和警告等。
    debug:记录详细的调试信息,如请求的详细信息、数据库操作等。
    trace:记录详细的跟踪信息,如线程和方法调用等。

    2023-10-13 17:24:39
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
PostgresChina2018_赖思超_PostgreSQL10_hash索引的WAL日志修改版final 立即下载
Kubernetes下日志实时采集、存储与计算实践 立即下载
日志数据采集与分析对接 立即下载