JHipster - Log Files

前端 未结 6 1323
借酒劲吻你
借酒劲吻你 2021-02-06 04:50

I have a JHipster application running and I would like to know where are the logs files. Where are they generated ? (It\'s a newbie question, but can\'t find anything)

I

6条回答
  •  梦毁少年i
    2021-02-06 05:14

    The default jh configuration src\main\resourcess\logback-spring.xml:

    
    
    
        
    
    
    
    
        
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    
        
            true
        
    
        
            
        
    
     

    includes spring-boot-master\spring-boot\src\main\resources\org\springframework\boot\logging\logback\base.xml

    
    
    
    
    
    	
    	
    	
    	
    	
    		
    		
    	
    
    which includes defaults.xml:

    
    
    
    
    
    	
    	
    	
    
    	
    	
    
    	
    		org.springframework.boot
    	
    
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    		
    	
    	
    		
    	
    

    console-appender.xml

    
    
    
    
    
    	
    		
    			${CONSOLE_LOG_PATTERN}
    			utf8
    		
    	
    

    and finally file-appender.xml

    
    
    
    
    
    	
    		
    			${FILE_LOG_PATTERN}
    		
    		${LOG_FILE}
    		
    			${LOG_FILE}.%i
    		
    		
    			10MB
    		
    	
    

    which is creating a spring.log file in the temp directory that rolls every 10MB.

    Here is a version that may be more appropriate for production.

    It enables the async file appender, and replaces the temp directory spring.log with debug, info (without trace or debug), and error (without info,trace,debug) log files in the catalina_base directory that roll each day.

    It uses an easily-parsed splunk format, and column widths that are easy for humans to scan.

    It includes columns that a simple Servlet Filter can use to add values to MDC for: IP=IP Address, S=Session Id, TX=Transaction Id, U=User Id. eg org.slf4j.MDC.put("TX", java.util.UUID.randomUUID().toString()); :

    
    
    
    	
    	
    	
    
      
      
    	
    	
    	
    	
      
      
    	  
      
      
    	
      
    	
    		org.springframework.boot
    	
    
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    	
    		
    	
    	
    		
    	
    
    
    
    
    	
    		
    			${CONSOLE_LOG_PATTERN}
    			utf8
    		
    	
    
    
        ${LOG_PATH}/debug.log    
            
              DEBUG
              ACCEPT
            
            
              INFO
              ACCEPT
            
            
              TRACE
              ACCEPT
            
            
              WARN
              ACCEPT
            
            
              ERROR
              ACCEPT
                
            utf-8${LOG_PATTERN}
            ${LOG_ARCHIVE_PREFIX}debug.log${LOG_ARCHIVE_DAYS}
        
    
        ${LOG_PATH}/info.log
            
              DEBUG
              DENY
            
            
              INFO
              ACCEPT
            
            
              TRACE
              DENY
            
            
              WARN
              ACCEPT
            
            
              ERROR
              ACCEPT
            
            utf-8${LOG_PATTERN}
            ${LOG_ARCHIVE_PREFIX}info.log${LOG_ARCHIVE_DAYS}
        
    
        ${LOG_PATH}/error.log
            
              DEBUG
              DENY
            
            
              INFO
              DENY
            
            
              TRACE
              DENY
            
            
              WARN
              ACCEPT
            
            
              ERROR
              ACCEPT
            
            utf-8${LOG_PATTERN}${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}
            ${LOG_ARCHIVE_PREFIX}error.log${LOG_ARCHIVE_DAYS}
        
    
        
            512
            
    		    
            
        
    
    	
    		
    		
    		
    		
    	
    
    
        
        
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    
        
            true
        
    
        
            
        
    
    

提交回复
热议问题