spring-boot use-log information

# logBack configuration
logging:
  path: logs
  level:
    com.fh: ERROR
    com.fh.mapper: DEBUG
  file: ${logging.path}/openplatform.log
  pattern:
    #file: "%5level %d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } [%thread] --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"
    #console: "%5level %d{yyyy-MM-dd HH:mm:ss.SSS}: [%thread] %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"
    file: "%-5level %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{req.remoteHost} %X{req.requestURI} %X{username} %logger - %msg%n"
    console: "%-5level %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{req.remoteHost} %X{req.requestURI} %X{username} %logger - %msg%n"

 

Spring-boot log prints:
                          The log level from low to high is divided into TRACE < DEBUG < INFO < WARN < ERROR < FATAL, if it is set to WARN, it will not be output below WAIN
If you add debug=true in application.properties, the core Logger will output more and more detailed content, but the log of your own application will not be output as DEbug
 
  • %d{HH:mm:ss.SSS}——log output time
  • %thread - the name of the process to output the log, this is useful in web applications and asynchronous task processing
  • %-5level - log level, and use 5 characters to align left
  • %logger{36} - the name of the log exporter
  • %msg - log message
  • %n - newline character for platform

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324979914&siteId=291194637