log monitoring service API-triggered logs and alerts users exclusively for critical system failures.
384
NOTE: Most of this code was done by AI as a experiment (In future this will be rewritten) ALSO VERY BUGY
JiriFlow is a real-time log monitoring system designed to centralize logging from various services and servers.
This software is provided "as is" without any guarantees or warranties. Use at your own risk.
JiriFlow is a real-time log monitoring system designed to centralize logging from various services, applications, and servers. Key features include:
Note: JiriFlow uses WebSockets to provide real-time log updates without requiring page refreshes.
All API requests require an API key included directly in your JSON payload or as a header. API key:
{
"apiKey": "your-api-key-here",
// other fields...
}
Your API key can be managed in the Settings page. You can:
Note: The API key is generated automatically on first run and stored securely in the database.
Warning: Keep your API key secure! Anyone with your API key can send logs to your system.
npm installnpm start or node main.jshttp://localhost:3000 or https://localhost:3000).docker pull articrexus/jiriflowdocker run -d -p 3000:3000 articrexus/jiriflowhttp://localhost:3000 or https://localhost:3000).Create a new log entry that will appear in real-time on the dashboard.
{
"apiKey": "your-api-key-here", // Required for authentication
"level": "info", // "info", "warning", "error", or "critical" (can also use "type" field instead)
"message": "Your log message", // Required
"service": "my-service", // Optional: any string value for categorizing logs (also accepts "context")
"serverName": "Server-1", // Optional: server name
"serverIp": "192.168.1.10" // Optional: server IP address (auto-detected if not provided)
}
| Field | Required | Description |
|---|---|---|
apiKey | Required | Your JiriFlow API key for authentication |
level or type | Optional | Log severity level. Values: "info", "warning", "error", "critical". Default: "info" |
message | Required | The log message content |
service or context | Optional | Service or application name. Default: "general" |
serverName | Optional | Name of the server or container generating the log |
serverIp | Optional | IP address of the server (auto-detected if omitted) |
Note: You can use either
levelortypeto specify the log level. Both fields work the same way.
Note: You can use eitherserviceorcontextfor the service name. Both fields work the same way.
Important: Thecriticallevel will trigger visual and audio alerts in the browser to get immediate attention!
{
"apiKey": "your-api-key-here",
"type": "critical",
"message": "SYSTEM FAILURE: Primary database is offline",
"service": "database-cluster",
"serverName": "Production-DB-Main"
}
{
"apiKey": "your-api-key-here",
"type": "error",
"message": "Database connection failed",
"service": "database-service",
"serverName": "DB-Server-1"
}
{
"id": 123,
"level": "info",
"message": "Your log message",
"timestamp": "2025-04-02T15:30:45.123Z",
"service": "my-service",
"serverName": "Server-1"
}
| Status Code | Description |
|---|---|
| 400 Bad Request | Missing required fields or invalid format |
| 401 Unauthorized | Invalid or missing API key |
| 500 Internal Server Error | Server encountered an error processing the request |
Additional Notes on Error Handling:
curl -X POST <%= baseUrl %>/api/logs \
-H "Content-Type: application/json" \
-d '{
"apiKey": "your-api-key-here",
"level": "error",
"message": "Failed to connect to payment gateway",
"service": "payment-service"
}'
fetch('<%= baseUrl %>/api/logs', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
apiKey: "your-api-key-here",
level: "error",
message: "Database connection failed",
service: "database-service",
serverName: "DB-01"
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import requests
import json
url = "<%= baseUrl %>/api/logs"
payload = {
"apiKey": "your-api-key-here",
"level": "warning",
"message": "High memory usage detected",
"service": "monitoring-agent",
"serverName": "web-server-01"
}
response = requests.post(url, json=payload)
print(response.status_code)
print(response.json())
To test in Postman, set the request method to POST, then add the following JSON body: /api/logs
{
"apiKey": "YOUR-API-KEY-HERE",
"level": "critical", // "info", "warning", "error", or "critical" (can also use "type" field instead)
"message": "cant connect to database",
"service": "database",
"serverName": "https",
"serverIp": "xxx.xxx.xxx.xxx"
}
The following endpoints are planned for future releases:
/api/logs/bulk - Create multiple log entries in a single request/api/logs - Retrieve logs with filtering and pagination/api/logs/export - Export logs to CSV format/api/status - Check API status and get basic informationCheck back for updates or subscribe to our release notifications.
The service (or context) field can be any string value you choose. Here are some examples:
| Use Case | Example Service Names |
|---|---|
| Microservices Architecture | auth-service, user-service, payment-service |
| Application Components | frontend, backend, database, cache |
| Application Modules | user-management, reporting, admin-panel |
| Process Types | web-server, background-job, cron-task |
| Deployment Environments | production-api, staging-worker, dev-frontend |
JiriFlow uses WebSockets to provide real-time log updates to the dashboard. When a log is received via the API, it is automatically broadcast to all connected clients.
Note: The WebSocket connection is automatically established when you visit the dashboard. No additional configuration is required.
All logs sent to the API will immediately appear in the dashboard for all connected users, making JiriFlow ideal for real-time monitoring and collaborative troubleshooting.
When integrating with JiriFlow, consider the following security best practices:
Warning: Never include passwords, tokens, or personally identifiable information in log messages.
The user-config.json file allows you to customize various settings of JiriFlow. Here's how you can modify it to suit your needs:
user-config.json file is located in the root directory of your JiriFlow installation.user-config.json file in a text editor."port" value under the "server" section.user-config.json file.Here's an example of the user-config.json file with descriptions of each setting:
{
"server": {
"port": 3000, // The port the server listens on.
"host": "0.0.0.0", // The host the server listens on.
"enableHttps": true // Enable or disable HTTPS.
},
"security": {
"defaultAdmin": {
"username": "admin", // Default admin username.
"password": "admin" // Default admin password.
},
"sessionTimeout": 24 // Session timeout in hours.
},
"database": {
"path": "./data/database.db" // Path to the SQLite database.
},
"logging": {
"directory": "./logs", // Directory to store log files.
"level": "info", // Log level (info, warning, error, critical).
"maxSize": "10m", // Maximum size of a log file.
"maxFiles": 5, // Maximum number of log files to keep.
"httpLogging": true // Enable or disable HTTP request logging.
},
"certificates": {
"method": "selfsigned", // Method to generate SSL certificates (selfsigned, mkcert, openssl, node-forge).
"paths": {
"cert": "./certificates/certificate.pem", // Path to the SSL certificate file.
"key": "./certificates/private-key.pem" // Path to the SSL key file.
}
}
}
Note: Ensure the JSON syntax is correct when modifying the
user-config.jsonfile. An invalid JSON format may prevent JiriFlow from starting correctly.
Q: Why am I getting a 401 error?
A: Ensure your API key is correct and provided in the request headers or body.
Q: How do I rotate my API key?
A: Use the Settings page to generate a new key, invalidating the old one.
0.1 : Release
docker pull articrexus/jiriflow:latest