Skip to content

Commit 70f63cb

Browse files
authored
Merge pull request #2 from dheerajcl/dheerajcl-patch-1
Update README.md
2 parents 2f9aaf9 + 51fc711 commit 70f63cb

File tree

1 file changed

+171
-1
lines changed

1 file changed

+171
-1
lines changed

README.md

Lines changed: 171 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,171 @@
1-
# Distributed_Logging_System
1+
# Distributed Logging System
2+
3+
## Project Overview
4+
5+
Effective log management is crucial for operational excellence in a microservices architecture. This project aims to streamline the collection, storage, and analysis of logs generated by various services, enhancing the ability to quickly track application behavior and identify errors. By capturing relevant metadata alongside each log entry and enabling real-time ingestion and querying, the system improves operational visibility and facilitates proactive responses to potential issues. Ultimately, this distributed logging framework enhances resilience and maintainability in a dynamic application landscape.
6+
7+
8+
## System Architecture & Flow
9+
![image](https://github.com/user-attachments/assets/60db1e53-cc5f-47db-b429-680677d1f3d8)
10+
11+
12+
### Components
13+
14+
1. **Microservices(Process):** Represent distributed nodes that independently generate logs and send heartbeat signals to monitor their status.
15+
2. **Log Accumulator:** Collects log data from each node, structures it, and forwards it to the Pub-Sub model for centralized log management.
16+
3. **Pub-Sub Model:** Acts as a communication layer, facilitating reliable, asynchronous distribution of logs.
17+
4. **Log Storage:** A system for indexing and storing logs in a searchable format for easy access and monitoring.
18+
5. **Alerting System:** Listens for specific log levels (e.g., ERROR, FATAL, etc) in real-time, generating alerts to ensure prompt responses to critical events.
19+
6. **Heartbeat Mechanism:** Provides failure detection by alerting when a node stops sending heartbeats, signaling that the node may have failed.
20+
21+
---
22+
23+
## Weekly Commit Milestones
24+
25+
### Week 1: Microservice and Log Generation Setup
26+
27+
**Completed Tasks:**
28+
*(Tick the boxes below to indicate completion.)*
29+
30+
- [x] Created 3 independent microservices:
31+
- PaymentService
32+
- OrderService
33+
- InventoryService
34+
- [x] Implemented log generation for each microservice.
35+
- [x] Added a heartbeat mechanism for periodic status updates.
36+
- [x] Implemented log message color coding for clarity.
37+
38+
**Next Steps:**
39+
- [ ] Create a trigger for missing heartbeats once the Pub-Sub model is implemented.
40+
41+
---
42+
43+
### Week 2: Log Accumulator and Pub-Sub Model Integration
44+
45+
**Tasks:**
46+
47+
- [ ] Configure the log accumulator to collect and structure logs.
48+
- [ ] Set up the Pub-Sub model (Apache Kafka) for log management.
49+
- [ ] Configure the subscriber to ensure seamless log consumption.
50+
51+
---
52+
53+
### Week 3: Alerting, Log Storage, and Final Integration
54+
55+
**Tasks:**
56+
57+
- [ ] Implement the alerting system for critical logs (ERROR, WARN).
58+
- [ ] Configure log storage using Elasticsearch.
59+
- [ ] Conduct final testing and validation of the complete pipeline.
60+
61+
---
62+
63+
## Tools & Technologies
64+
65+
- **Programming Language:** Python
66+
- **Log Accumulator:** Fluentd or Apache Flume
67+
- **Pub-Sub Model:** Apache Kafka
68+
- **Log Storage:** Elasticsearch
69+
- **Visualization (Optional):** Kibana
70+
71+
---
72+
73+
## Log Levels
74+
75+
- **INFO:** General system operations information.
76+
- **WARN:** Indications of potential issues.
77+
- **ERROR:** Errors that allow continued operation.
78+
- **FATAL:** Critical issues requiring immediate attention.
79+
80+
---
81+
82+
## Metadata for Logs
83+
84+
**Example Structures:**
85+
86+
- **Microservice Registration Message:**
87+
```json
88+
{
89+
"node_id": "<unique node-id>",
90+
"message_type": "REGISTRATION",
91+
"service_name": "PaymentService",
92+
"timestamp": "<timestamp>"
93+
}
94+
```
95+
96+
- **INFO Log:**
97+
```json
98+
{
99+
"log_id": "<unique log-id>",
100+
"node_id": "<node-id>",
101+
"log_level": "INFO",
102+
"message_type": "LOG",
103+
"message": "<Log Message>",
104+
"service_name": "<ServiceName>",
105+
"timestamp": "<timestamp>"
106+
}
107+
```
108+
109+
- **WARN Log:**
110+
```json
111+
{
112+
"log_id": "<unique log-id>",
113+
"node_id": "<node-id>",
114+
"log_level": "WARN",
115+
"message_type": "LOG",
116+
"message": "",
117+
"service_name": "<ServiceName>",
118+
"response_time_ms": "",
119+
"threshold_limit_ms": "",
120+
"timestamp": "<timestamp>"
121+
}
122+
```
123+
124+
- **ERROR Log:**
125+
```json
126+
{
127+
"log_id": "<unique log-id>",
128+
"node_id": "<node-id>",
129+
"log_level": "ERROR",
130+
"message_type": "LOG",
131+
"message": "",
132+
"service_name": "<ServiceName>",
133+
"error_details": {
134+
"error_code": "",
135+
"error_message": ""
136+
},
137+
"timestamp": "<timestamp>"
138+
}
139+
```
140+
141+
- **Heartbeat Message:**
142+
```json
143+
{
144+
"node_id": "<node-id>",
145+
"message_type": "HEARTBEAT",
146+
"status": "UP/DOWN",
147+
"timestamp": "<timestamp>"
148+
}
149+
```
150+
151+
- **Microservice Registry:**
152+
```json
153+
{
154+
"message_type":"REGISTRATION",
155+
"node_id": "<node-id>",
156+
"service_name": "<ServiceName>",
157+
"status": "UP/DOWN",
158+
"timestamp": "<timestamp>"
159+
}
160+
```
161+
162+
163+
## References
164+
165+
- [Distributed Logging System Design on Medium](<https://medium.com/@krrishan7495/distributed-logging-designing-a-robust-system-for-enhanced-monitoring-64ddb0838882>)
166+
- [Distributed Logging Architecture on DZone](<https://dzone.com/articles/distributed-logging-architecture-for-microservices>)
167+
- [Remote Kafka Connection Guide by Bitnami](<https://docs.bitnami.com/google-templates/infrastructure/kafka/administration/connect-remotely/>)
168+
- [Fluentd Output to Kafka Documentation](<https://docs.fluentd.org/0.12/output/kafka>)
169+
- [Python Client for Elasticsearch - Getting Started Guide](<https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/getting-started-python.html>)
170+
171+

0 commit comments

Comments
 (0)