No log4j2 configuration file found. Using default configuration: logging only errors to the console

前端 未结 15 1115
情深已故
情深已故 2020-12-04 22:59
$ java -Dlog4j.configuration=file:///path/to/your/log4j2.xml -jar /path/to/your/jar_file.jar

Written to the console, you get

ERROR          


        
15条回答
  •  既然无缘
    2020-12-04 23:46

    I use hive jdbc in a java maven project and have the same issues.

    My method is to add a log4j2.xml file under src/main/java/resources

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    public class MyClassName {
        private static final Logger LOG = LoggerFactory.getLogger(MyClassName.class);
    }
    

    log4j2.xml

    
    
        
            
                
            
        
        
            
            
            
            
                
            
        
    
    

提交回复
热议问题