Skip to content

ARACOOOL/collog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

collog

Build Status

Collog is a standalone server that provides a REST API to collect your logs.

Launch

server.exe -h=":8080" -jk="qwerty" -dsn="root:qwerty@tcp(192.168.99.100)/logs"

Parameters

h   - server host
jk  - JWT secret key
ld  - Logs directory (for the server logs)
dsn - Mysql data source name

Usage

Store a log

POST /logs

Authorization: Bearer {token}
{
	"source": "web app",
	"category": "auth",
	"level": 400,
	"message": "Invalid credentials",
	"trace": "{}",
	"payload": {"login": "user22"}
}

Get list of logs

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 parameters

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

JWT Token

Headers

{
  "alg": "HS512",
  "typ": "JWT"
}

Payload

{
  "email": "test@test.com",
  "iat": 1516239022
}

JWT documentation

About

Collog is a standalone server for your logs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages