slf4j

日志规范之slf4j整合JDK14以及Simple的使用

百般思念 提交于 2020-01-26 10:48:42
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>cn.learn.slf4j</groupId> <artifactId>learn-slf4j</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.26</version> </dependency> <!--<dependency>--> <!--<groupId>org.slf4j</groupId>--> <!--<artifactId>slf4j-jdk14<

IntelliJ IDEA出现错误Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

萝らか妹 提交于 2020-01-25 20:02:20
解决方案: 1、找到项目的pom.xml文件,添加依赖。如下图: 代码: <dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 --> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </dependency> <dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple --> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> </dependency> 2、然后运行clean清除一下缓存,如下图: 3、最后运行项目,就成功啦! 来源: CSDN 作者: 已知逆流而上 链接: https://blog.csdn.net

监控Kafka消费进度

最后都变了- 提交于 2020-01-25 17:21:24
使用Kafka作为消息中间件消费数据时,监控Kafka消费的进度很重要。其中,在监控消费进度的过程中,主要关注消费Lag。 常用监控Kafka消费进度的方法有三种,分别是使用Kafka自带的命令行工具、使用Kafka Consumer API和Kafka自带的JMX监控指标,这里介绍前两种方法。 注: 内网IP:10.12.100.126 10.12.100.127 10.12.100.128 外网IP:47.90.133.76 47.90.133.77 47.90.133.78 用户名:server1 server2 server3 1 使用kafka自带的命令行工具 针对Kafka高级消费API,使用kafka自带的命令行工具kafka-consumer-groups.sh脚本直接查看Kafka消费进度 1.1 列出存在的所有消费者组 (base) root@node3:/opt/kafka/kafka_2.11-0.10.2.2/bin# kafka-consumer-groups.sh new-consumer --bootstrap-server 10.12.100.126:9092,10.12.100.127:9092,10.12.100.128:9092 --list Note: This will only show information about

cxf inbound and outbound message logging to the separate log file

时光总嘲笑我的痴心妄想 提交于 2020-01-22 23:00:28
问题 I looked up all messages but did not find a clear answer for that question. How can I configure logging to log CXF inbound and outbound restful messages ? I have the following setup. File org.apache.cxf.Logger with org.apache.cxf.common.logging.Log4jLogger applicationContext.xml has the following (it sounds silly, but it is the only place for interceptors I could get messages output) <bean id="abstractLoggingInterceptor" abstract="true"> <property name="prettyLogging" value="true"/> </bean>

@slf4j

时间秒杀一切 提交于 2020-01-19 06:10:26
@slf4j 如果不想每次都写private final Logger logger = LoggerFactory.getLogger(XXX.class); 可以用注解@Slf4j,它的主要目的就是我们想看自己的代码日志信息,可以适用logger.xx。 一、在pom文件加入依赖 < dependency > < groupId > org . projectlombok < / groupId > < artifactId > lombok < / artifactId > < / dependency > 二、代码 package com . sell ; import lombok . extern . slf4j . Slf4j ; import org . junit . Test ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import org . junit . runner . RunWith ; import org . springframework . boot . test . context . SpringBootTest ; import org . springframework . test . context . junit4 .

Apache FTP server is not seeing a logging jar package that exists in the class path

筅森魡賤 提交于 2020-01-17 03:27:06
问题 I'm using Apache's FTP server. The FTP server is loaded through a singleton bean in Glassfish. I was previously able to run the FTP server when I was using a PropertiesUserManager, but I wanted to tie in some JPA logic, so I wrote a custom class class that implement's the UserManager interface. However, I'm facing a class loading issue. The slf4j-api-1.6.1.jar file and the slf4j-jdk14-1.6.1.jar file exists in glassfish's lib folder and I have restarted glassfish. Here's the stack trace: javax

CentOS 7 + Hadoop 3.2 安装 Hive 3.1.2,启动hive报错

五迷三道 提交于 2020-01-16 02:11:16
参考文档:https://www.cnblogs.com/caoxb/p/11333741.html 执行hive,报错 which: no hbase in ( /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/java/jdk1.8/bin:/usr/local/java/jdk1.8/jre/bin:/usr/local/hadoop/hadoop-3.2.0/bin:/usr/local/hive/apache-hive-3.1.2-bin/bin:/root/bin ) SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [ jar:file:/usr/local/hive/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar ! /org/slf4j/impl/StaticLoggerBinder.class ] SLF4J: Found binding in [ jar:file:/usr/local/hadoop/hadoop-3.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar !

MyBatis中的日志模块源码分析

三世轮回 提交于 2020-01-14 08:58:41
MyBatis中的日志模块源码分析 概览 MyBatis源码依赖的开源日志组件有: < dependency > < groupId > org.slf4j </ groupId > < artifactId > slf4j-api </ artifactId > < version > 1.7.30 </ version > < optional > true </ optional > </ dependency > < dependency > < groupId > org.slf4j </ groupId > < artifactId > slf4j-log4j12 </ artifactId > < version > 1.7.30 </ version > < optional > true </ optional > </ dependency > < dependency > < groupId > log4j </ groupId > < artifactId > log4j </ artifactId > < version > 1.2.17 </ version > < optional > true </ optional > </ dependency > < dependency > < groupId > org.apache.logging

Failed to instantiate SLF4J LoggerFactory on Spring 'mvc-basic' tutorial

时光怂恿深爱的人放手 提交于 2020-01-14 02:57:08
问题 I'm trying a Spring 3.x tutorial on Eclipse 3.7 with m2e and Maven Integration for WTP plugins installed. I converted the above tutorial to Maven Project, but when i deploy the web application i get the following exception: Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFoundError: org/apache/log4j/Level My pom.xml look like this: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001

Missing SLF4J logger on spark workers

不打扰是莪最后的温柔 提交于 2020-01-14 01:37:22
问题 I am trying to run a job via spark-submit . The error that results from this job is: Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2625) at java.lang.Class.getMethod0(Class.java:2866) at java.lang.Class.getMethod(Class.java:1676) at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494) at sun.launcher.LauncherHelper.checkAndLoadMain