Log Server is a centralized schema-on-write log sink. Right now, the application covers very simple functionalities, e.g. creating schemas, log entries and then retrieving them back to the user. It validates the data structure and makes sure that data is consistent (every log has it's schema). It supports data transmission via HTTP and data events via WebSocket also.
🎯 The current user workflow:
- 📋 Create/Update log schemas
- 📤 Push/Update logs continuously to the sink
- 📥 Retrieve and analyze logs anytime
- 🔄 Repeat the push/retrieve cycle as needed
- 🗑️ Delete schemas or individual logs anytime
- ✅ Schema Validation — Ensures data consistency across all logs
- ✅ Centralized — All your logs in one secure place
- ✅ Simple HTTP API — Easy to integrate with any system
- ✅ Data Integrity — Every log is validated against its schema
- ✅ Live data updates - Every log write/deletion is now being pushed via WebSocket
- Docker and Docker Compose installed
- Basic understanding of JSON and HTTP requests
The project runs on top of docker compose and is necessary in order to run the software
in its production and development workflow.
To run the production workflow in the background, run this command:
docker compose -f docker-compose.yml up -dThere are two available interfaces:
- pure HTTP requests for writing and reading data
- WebSocket for getting live write updates on the data
curl \
--request POST \
--location http://localhost:8080/schemas \
--header "Content-Type: application/json" \
--data '{
"name": "temperature-readings",
"version": "1.0.0",
"description": "Logs for the temperature sensors inside my room",
"schema_definition": {
"type": "object",
"properties": {
"name": { "type": "string" },
"reading": { "type": "number" }
},
"required": [ "name", "reading" ]
}
}'Response:
{
"id": "891db49b-4d64-4ba0-b075-156c8c17ce1d",
"name": "temperature-readings",
"version": "1.0.0",
"description": "Logs for the temperature sensors inside my room",
"schema_definition": {
"properties": {
"name": {
"type": "string"
},
"reading": {
"type": "number"
}
},
"required": [
"name",
"reading"
],
"type": "object"
},
"created_at": "2025-11-20T20:52:14.548098+00:00",
"updated_at": "2025-11-20T20:52:14.548098+00:00"
}curl \
--request POST \
--location http://localhost:8080/logs \
--header "Content-Type: application/json" \
--data '{
"schema_id": "891db49b-4d64-4ba0-b075-156c8c17ce1d",
"log_data": {
"name": "desk",
"reading": 34
}
}'Response:
{
"id": 10,
"schema_id": "891db49b-4d64-4ba0-b075-156c8c17ce1d",
"log_data": {
"name": "desk",
"reading": 34
},
"created_at": "2025-11-20T20:54:59.555233+00:00"
}curl \
--request GET \
--location http://localhost:8080/logs/schema/temperature-readings/1.0.0Response:
{
"logs": [
{
"created_at": "2025-11-20T20:54:59.555233+00:00",
"id": 10,
"log_data": {
"name": "desk",
"reading": 34
},
"schema_id": "891db49b-4d64-4ba0-b075-156c8c17ce1d"
}
]
}In order to get live updates on the logs, you have to somehow get notified by the server and you can achieve it by connecting to the WebSocket endpoint of the application.
# If you want to listen to all logs
websocat "ws://localhost:8081/ws/logs"
# And if you want to listen to only a specific schema
websocat "ws://localhost:8081/ws/logs?schema_id=0a9dadf1-fd1b-4727-88d5-98aad5ce70a3"Note: If you provide an invalid or non-existent schema_id,
the WebSocket connection will fail with a 404 Not Found error:
websocat: WebSocketError: Received unexpected status code (404 Not Found)Make sure the schema exists before attempting to connect.
The following events are currently supported:
{
"event_type": "created",
"id": 5826,
"schema_id": "0a9dadf1-fd1b-4727-88d5-98aad5ce70a3",
"log_data": {
"message":"Hello World from the working WebSocket connection!"
},
"created_at": "2025-12-05T11:13:36.361797+00:00"
}{
"event_type": "deleted",
"id": 5826,
"schema_id": "0a9dadf1-fd1b-4727-88d5-98aad5ce70a3"
}