Collog is a standalone server that provides a REST API to collect your logs.
server.exe -h=":8080" -jk="qwerty" -dsn="root:qwerty@tcp(192.168.99.100)/logs"
h - server host
jk - JWT secret key
ld - Logs directory (for the server logs)
dsn - Mysql data source name
POST /logs
Authorization: Bearer {token}
{
"source": "web app",
"category": "auth",
"level": 400,
"message": "Invalid credentials",
"trace": "{}",
"payload": {"login": "user22"}
}
GET /logs
Authorization: Bearer {token}
Response
[
{
"id": "19440916-9e24-4ce0-9770-f38eba0d6667",
"source": "web app",
"category": "auth",
"level": 400,
"message": "Invalid credentials",
"trace": "{}",
"payload": {
"login": "user22"
},
"created_at": "2020-04-19 16:06:36"
}
]
Filter by a name of source
/logs?source={sourceName}
Filter by a name of category
/logs?category={categoryName}
Filter by an error level
/logs?level=400
Headers
{
"alg": "HS512",
"typ": "JWT"
}
Payload
{
"email": "test@test.com",
"iat": 1516239022
}