ssm框架整合log4j2搭建
pom.xml
4.0.0 com.yy music 1.0-SNAPSHOT war music Maven Webapp http://www.example.com UTF-8 1.10 1.10 5.1.0.RELEASE 2.3.3 4.0.1 3.4.6 1.3.2 1.1.11 8.0.12 2.11.1 junit junit 4.11 test org.springframework spring-webmvc ${spring.version} org.springframework spring-jdbc ${spring.version} javax.servlet.jsp javax.servlet.jsp-api ${jsp.version} provided javax.servlet javax.servlet-api ${servlet.version} provided org.mybatis mybatis ${mybatis.version} org.mybatis mybatis-spring ${mybatis-spring.version} com.alibaba druid ${druid.version} mysql mysql-connector-java ${mysql.version} org.apache.logging.log4j log4j-slf4j-impl ${log4j.version} org.apache.logging.log4j log4j-web ${log4j.version} org.apache.logging.log4j log4j-jcl ${log4j.version} music maven-clean-plugin 3.0.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.7.0 maven-surefire-plugin 2.20.1 maven-war-plugin 3.2.0 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2
web.xml
/login.jsp contextConfigLocation classpath:spring/spring.xml org.springframework.web.context.ContextLoaderListener org.springframework.web.util.IntrospectorCleanupListener org.apache.logging.log4j.web.Log4jServletContextListener spring-mvc org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:spring/spring-mvc.xml spring-mvc /
spring-mvc.xml
spring.xml
mybatis-config.xml
jdbc.properties
jdbc.driverClassName = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql://localhost:3306/music?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
jdbc.username = root
jdbc.password = root
log4j2.xml
%d{yyyy-MM-dd HH:mm:ss.SSS} [%t-%L] %-5level %logger{36} - %msg%n
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
