zoukankan      html  css  js  c++  java
  • Spring Boot 动态修改 log level

    引入依赖

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    

    修改配置

    management: # https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.enabling
      endpoints:
          exposure:
            include: loggers
    

    运行程序

    运行 Spring Boot 程序

    日志级别查询与修改

    查看全部

    请求方式:HTTP GET
    请求地址:http://{ip}:{host}/actuator/loggers

    查看某个

    请求方式:HTTP GET
    请求地址:http://{ip}:{host}/actuator/loggers/{name}

    例如 http://{ip}:{host}/actuator/loggers/ROOT

    修改某个

    请求方式:HTTP POST
    内容类型:Content-Type:application/json
    请求地址:http://{ip}:{host}/actuator/loggers/{name}
    请求参数:

    {
        "configuredLevel": "WARN"
    }
    

    修改 ROOT 可实现整体性修改

  • 相关阅读:
    apns libcurl
    apns libcurl
    epoll
    epoll
    Linux服务器压测
    Linux服务器压测
    libevent
    libevent
    shell脚本
    shell脚本
  • 原文地址:https://www.cnblogs.com/myesn/p/15349215.html
Copyright © 2011-2022 走看看