Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microservices Deployment Cookbook

You're reading from   Microservices Deployment Cookbook Deploy and manage scalable microservices

Arrow left icon
Product type Paperback
Published in Jan 2017
Publisher Packt
ISBN-13 9781786469434
Length 378 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vikram Murugesan Vikram Murugesan
Author Profile Icon Vikram Murugesan
Vikram Murugesan
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Building Microservices with Java FREE CHAPTER 2. Containerizing Microservices with Docker 3. Deploying Microservices on Mesos 4. Deploying Microservices on Kubernetes 5. Service Discovery and Load Balancing Microservices 6. Monitoring Microservices 7. Building Asynchronous Streaming Systems with Kafka and Spark 8. More Clustering Frameworks - DC/OS, Docker Swarm, and YARN

Aggregating logs into Kafka using Log4J


Log management is a critical part of any microservice deployment. When it comes to debugging your application, the two things that matter a lot are logs and metrics. We've already learned how to use metrics to monitor our application, and in this recipe, we will learn how to consolidate our logs. Logs can be stored in plenty of stores. In this recipe, we will look at how to store our logs in a Kafka topic. Once we get our log messages in a Kafka topic, we can use Log Management tools to make some sense out of it.

Getting ready

In this recipe, we will be configuring the geolocation microservice to send log messages over to a Kafka topic called geolocationLogs.

Let's get ready by creating the topic in Kafka. If you don't have Kafka up and running, run it using Docker Compose.

Open a new terminal shell and navigate to the home directory of Kafka. Execute the following command:

        ./bin/kafka-topics.sh --create --topic geolocationLogs --replication-factor...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image