logback日志详细配置












  
  

  
  

  
  
  
  

  
  
    
    
        ALL
    
    
      ${CONSOLE_LOG_PATTERN}
      UTF-8
    
  

  
  
    ${LOG_PATH:-./logs}/trace.log
    
      ${LOG_PATTERN}
      UTF-8
    
    
    
      
      ${LOG_PATH:-./logs}/trace/trace-%d{yyyy-MM-dd}-%i.log
      
      
        100MB
      
      
      100
      
      true
    
    
    
      trace
      ACCEPT
      DENY
    
  

  
  
    ${LOG_PATH:-./logs}/debug.log
    
      ${LOG_PATTERN}
      UTF-8
    
    
    
      
      ${LOG_PATH:-./logs}/debug/debug-%d{yyyy-MM-dd}-%i.log
      
      
        100MB
      
      
      100
      
      true
    
    
    
      debug
      ACCEPT
      DENY
    
  

  
  
    ${LOG_PATH:-./logs}/info.log
    
      ${LOG_PATTERN}
      UTF-8
    
    
    
      
      ${LOG_PATH:-./logs}/info/info-%d{yyyy-MM-dd}-%i.log
      
        100MB
      
      
      100
      
      true
    
    
    
      info
      ACCEPT
      DENY
    
  

  
  
    ${LOG_PATH:-./logs}/warn.log
    
      ${LOG_PATTERN}
      UTF-8
    
    
    
      ${LOG_PATH:-./logs}/warn/warn-%d{yyyy-MM-dd}-%i.log
      
        100MB
      
      
      100
      
      true
    
    
    
      warn
      ACCEPT
      DENY
    
  

  
  
    ${LOG_PATH:-./logs}/error.log
    
      ${LOG_PATTERN}
      UTF-8
    
    
    
      ${LOG_PATH:-./logs}/error/error-%d{yyyy-MM-dd}-%i.log
      
        100MB
      
      
      100
      
      true
    
    
    
      error
      ACCEPT
      DENY
    
  

  
  
    ${LOG_PATH:-./logs}/fatal.log
    
      ${LOG_PATTERN}
      UTF-8
    
    
    
      ${LOG_PATH:-./logs}/fatal/fatal-%d{yyyy-MM-dd}-%i.log
      
        100MB
      
      
      100
      
      true
    
    
    
      fatal
      ACCEPT
      DENY
    
  

  


  
  
    
      
      
      
      
      
      
      
    
  

  
  
    
      
      
      
      
    
  

日志会生成与src同级别的目录logs里面

打成jar包后运行,日志目录跟jar所在目录下生成logs文件夹,里面就是日志(在jar目录运行启动jar包)

你可能感兴趣的:(spring,java,日志,logback)