# LoggingAppender日志收集插件 **Repository Path**: jxttian/LoggingAppender ## Basic Information - **Project Name**: LoggingAppender日志收集插件 - **Description**: 收集java日志到Redis或者Kafka中的插件,日志收集完之后可使用ELK栈做分析(暂时只支持Logback) - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: develop - **Homepage**: https://github.com/jxttian/LoggingAppender.git - **GVP Project**: No ## Statistics - **Stars**: 156 - **Forks**: 55 - **Created**: 2018-02-27 - **Last Updated**: 2024-11-04 ## Categories & Tags **Categories**: logging **Tags**: None ## README # logging-appender ##logback -- pom.xml添加依赖 ```xml org.redisson redisson 3.2.3 org.apache.kafka kafka-clients 0.10.1.1 net.myscloud.plugin logging-appender 1.0-SNAPSHOT ``` -- logback.xml添加Appender ```xml 127.0.0.1:6379 redis-log test-application 127.0.0.1:9092 topic1 test-application ``` -- 日志格式 ```json { "@timestamp": "2017-01-17T10:40:53.129+0800", "host": "10.2.85.49", "level": "WARN", "logger": "net.myscloud.plugin.logging.logback.redis.appender.LogbackRedisAppenderTest", "message": "test87", "source": "test-application", "thread": "main" } ``` -- https://www.elastic.co/guide/en/logstash/current/plugins-inputs-redis.html#plugins-inputs-redis -- 集成SpringBoot 如果需要把Redis或者Kafka地址配置在SpringBoot配置文件中可使用 ```xml ${kafkaAddresses} topic1 test-application ```