A secure, efficient, and scalable log management solution built with Kotlin and Go. This system provides a robust way to collect, encrypt, and store application logs with high performance and security.
- π Secure Transmission: AES encryption with CFB mode and key derivation
- π Authentication: Basic authentication for API endpoints
- π Organized Storage: Logs stored by device identifier (IMEL)
- β‘ High Performance: Go backend for fast processing
- π Cross-Platform: Kotlin client for easy integration
- π Retry Mechanism: Built-in retry logic for reliability
- Go 1.21 or later
- Kotlin 1.9.21 or later
- Java 17 or later
- Gradle 8.0 or later
-
Clone the repository:
git clone https://github.com/arya458/LogManagingSystem.git cd LogManagingSystem -
Build the Go API:
./build.bat
The executable will be created in
build/api/LogManagingApi-windows-64.exe -
Build the Kotlin library:
cd LogManagingKotlinLib ./gradlew buildThe JAR will be created in
build/libs/
Add the following dependencies to your Kotlin project:
dependencies { implementation("org.aria.danesh:logmanagingkotlinlib:1.0.0") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") implementation("com.squareup.okhttp3:okhttp:4.12.0") }Example usage:
import kotlinx.coroutines.runBlocking import org.aria.danesh.logmanagingkotlinlib.LogManagingKotlinLib fun main() = runBlocking { val logManager = LogManagingKotlinLib( apiUrl = "http://your-api-host:port", username = "your-username", password = "your-password", encryptionKey = "your-32-byte-encryption-key", maxRetries = 3, retryDelay = 1, timeout = 30 ) val result = logManager.sendEncryptedLog( imel = "device-identifier", error = "Error message", level = "ERROR", source = "application-name" ) result.fold( onSuccess = { message -> println("Log sent successfully: $message") }, onFailure = { exception -> println("Error sending log: ${exception.message}") } ) }The Go API provides the following endpoints:
POST /- Send encrypted logsGET /health- Check server health
Example using curl:
curl -X POST \ -H "Authorization: Basic $(echo -n 'username:password' | base64)" \ -H "Content-Type: application/json" \ -d '{"encrypted_data":"your-encrypted-data"}' \ http://localhost:8080/- All log data is encrypted using AES encryption with CFB mode
- Key derivation using SHA-256 for enhanced security
- Basic authentication for API access
- Secure credential handling
- No sensitive data in version control
LogManagingSystem/ βββ LogManagingApi/ # Go backend API β βββ main.go # Main API implementation β βββ build.bat # Build script βββ LogManagingKotlinLib/ # Kotlin client library β βββ src/ # Source code β βββ build.gradle.kts # Build configuration βββ docs/ # Documentation βββ index.html # Documentation website -
Go API:
cd LogManagingApi go build -o LogManagingApi.exe -
Kotlin Library:
cd LogManagingKotlinLib ./gradlew build
We welcome contributions! Please feel free to submit pull requests or report issues.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Aria Danesh - GitHub
- Go team for the excellent standard library
- Kotlin team for the amazing language and ecosystem
- All contributors who help improve this project