美文网首页
集成log4j2

集成log4j2

作者: perfect_jimmy | 来源:发表于2017-12-14 10:14 被阅读232次

问题1:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/YSTen/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/YSTen/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.7/log4j-slf4j-impl-2.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
image.png

发现冲突的jar在spring-boot-starter中,所以最终的pom文件如下:


image.png

问题2:

2017-12-14 10:07:15,962 main INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.

添加依赖

 <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-web</artifactId>
      <version>2.10.0</version>
    </dependency>

相关文章

  • 目录

    集成log4j2

  • Skywalking之五整合

    个人专题目录 Skywalking项目集成 相关Maven依赖引入 traceId 集成到日志组件Log4j2,t...

  • SpringBoot集成Log4j2框架

    1.说明 本文详细介绍Spring Boot集成Log4j2框架的方法,基于已经创建好的Spring Boot工程...

  • springboot常用starter③-log4j2

    还没引入之前日志 修改后 集成log4j2过程 引入 spring-boot-starter-log4j2 直接启...

  • 日志

    使用Slf4j集成Log4j2构建项目日志系统的完美解决方案https://www.cnblogs.com/haf...

  • 集成log4j2

    问题1: 发现冲突的jar在spring-boot-starter中,所以最终的pom文件如下: 问题2: 添加依赖

  • spring-cloud微服务项目实战(8)-log4j2集成s

    目的 在log4j2的基础上集成sleuth,进行日志调用链跟踪,进行日志分析 改造项目接口,将原有/task/i...

  • Springboot[日志篇]--集成log4j2输出到mong

      开启本节之前,有个假设条件,你已经在你的Springboot项目中完成对log4j2的集成。如果还没有,请先阅...

  • log4j2的认知

    目的 最近听说log4j2的性能很不错,所以来学习学习,最终集成到springboot中。花了一周的时间,对log...

  • SpringMVC-集成slf4j-log4j2

    本篇文章主要介绍SpringMVC如何集成slf4j以及log4j2slf4j与log4j2的介绍 Jar依赖 l...

网友评论

      本文标题:集成log4j2

      本文链接:https://www.haomeiwen.com/subject/ykmhwxtx.html