A versatile, tag-based logging system designed for cross-platform applications. Night Owl provides a straightforward way to collect, store, and retrieve logs with custom tags, built with performance and simplicity in mind.
While developing applications across multiple platforms, I needed a straightforward, efficient logging service that could collect logs with tags from various sources. Existing solutions like Sentry and Datadog were either not suitable for simple log lookup, too expensive, or overly complex for my needs.
Night Owl π¦ is a versatile, tag-based logging system designed to be simple, fast, and platform-independent. Built with rust and SQLite at its core, it allows developers to define custom tags and easily send logs to a server for later retrieval based on these tags.
- π·οΈ Custom tag definition
- π Two components for each log entry: message and data
- π Support for predefined tags like User, System, Other
- π Fallback type for unknown tags
- β‘ Fast and efficient rust core implementation
- πΎ SQLite database for robust storage and quick retrieval
- π³ Docker image for easy deployment
- π¦ SDKs for multiple platforms (Flutter, JavaScript)
- π Extensibility to support most programming language
- Deploy Night Owl using the provided Docker image
- Define your tags in a configuration file
- Send logs from your application using the platform-specific SDK
- Logs are stored in the SQLite database with their associated tags
- Retrieve logs later using tag-based queries
// Sending a log with user tag
NightOwl.log("User", "user registered", {
"userId": "12345",
"email": "user@example.com"
});
// Sending a log with system tag
NightOwl.log("System", "Application startup", {
"version": "1.0.0",
"buildNumber": "42"
});
// Get all logs with a specific tag
const userLogs = await NightOwl.getLogs("User");
// Get logs within a time range
const recentLogs = await NightOwl.getLogs(
"System",
{
startTime: new Date(Date.now() - 24 * 60 * 60 * 1000),
endTime: new Date()
}
);
// Search logs with specific criteria
const filteredLogs = await NightOwl.searchLogs({
tags: ["User", "System"],
query: "error",
limit: 100
});
Create a log_config.json
file in your project:
{
"tags": {
"User": {
"retention": "30d",
"priority": "normal"
},
"System": {
"retention": "90d",
"priority": "high"
},
"Debug": {
"retention": "7d",
"priority": "low"
}
}
}
Night Owl consists of three main components:
-
Core Engine (rust)
- Handles log processing and storage
- Optimized for performance
- Platform-independent implementation
-
SQLite Database
- Manages persistent storage
- Efficient query execution
- Robust data integrity
-
Platform SDKs
- Native implementations for each platform
- Consistent API across languages
- Optimized for each environment
Method | Description |
---|---|
log(String tag, String message, Object data) |
Logs a new entry |
getLogs(String tag, Options options) |
Retrieves logs by tag |
searchLogs(SearchOptions options) |
Searches logs with criteria |
Coming soon...
- Flutter: [Link to Flutter package] soon
- JavaScript: [Link to npm package] soon
- Python: Coming soon
- Java: Coming soon
- Go: Coming soon
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ