spring-boot-log-to-kafka-example | Spring Boot log to Kafka example | Pub Sub library
kandi X-RAY | spring-boot-log-to-kafka-example Summary
kandi X-RAY | spring-boot-log-to-kafka-example Summary
Spring Boot log to Kafka example
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Log some events
- Gets the Marker for audit records
- Do nothing
- The scheduled task executor
- Waits for 10 seconds
- Convert the audit message to a JSON string
- Logs some data
- Main entry point
spring-boot-log-to-kafka-example Key Features
spring-boot-log-to-kafka-example Examples and Code Snippets
Community Discussions
Trending Discussions on spring-boot-log-to-kafka-example
QUESTION
I was asked to how to capture logging output from a Spring Boot application that runs as a Java action from Oozie.
My initial thought was that it would be possible edit some log4j properties to capture the application logs inside YARN or Oozie. Then it occurred to me that that Kafka would be a much easier way to capture and aggregate log messages, for a specific application, running on various cluster nodes. It's much easier to monitor a distributed system by subscribing to a topic than fishing through log files.
I notice that Kafka has a log4j appender and so I tried to create a minimal reproducible example (posted on github: https://github.com/alexwoolford/spring-boot-log-to-kafka-example). Here's a snippet from pom.xml
:
ANSWER
Answered 2017-Jan-30 at 00:37Log4j2 has a Kafka appender. It was necessary to add the spring-boot-starter-log4j2
and jackson-databind
artifacts to the pom.xml
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spring-boot-log-to-kafka-example
You can use spring-boot-log-to-kafka-example like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-boot-log-to-kafka-example component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page