log4j2.xml配置详细遇到坑



    
        /opt/apache-tomcat-9.0.6/logs

        mylog
    
   
    
        
            
        





        
        
            
            
            
                %date{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - %msg%n 
            
            
                
                
                
                
            
            
            
                
                    
                    
                    
                
            
        

    

    
        
            
        
        
            
        
    

 

这里遇到一个坑,Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile.

Appenders中File和RollingFile节点不同同时存在,否者初始化日志工程时报错。

集成需要的maven,这个集成spring mvc 

  
  		UTF-8
		
		4.3.7.RELEASE
		2.8.2
		1.7.25
		1.3.1
		1.2.31
  
  

		
		
		  org.slf4j
		  slf4j-api
		  ${slf4j.version}
		
		
		  org.slf4j
		  jcl-over-slf4j
		  ${slf4j.version}
		
		
		
		
			org.apache.logging.log4j
			log4j-slf4j-impl
			${log4j2.version}
			
				
					org.slf4j
					slf4j-api
				
			
		
		
		
			org.apache.logging.log4j
			log4j-jcl
			${log4j2.version}
		
		
			org.apache.logging.log4j
			log4j-api
			${log4j2.version}
		
		
			org.apache.logging.log4j
			log4j-core
			${log4j2.version}
		
		
			org.apache.logging.log4j
			log4j-web
			${log4j2.version}
		


		
  

你可能感兴趣的:(log4j2,log4j2)