Support with donation
LogStack is a simple log repository made with Go (Golang).
It use a simple plugin mechanism that let you use some different datasources to store and retrive logs.
Today i have implemented MongoDB and ElasticSearch 2.0 datasources, feel free to implement more :)
LogStack configuration is a simple INI file called "config.ini".
Example for MongoDB as the datasource:
[server] port = 8080 dsname = mongodb dshost = 127.0.0.1 dscontainer = logstack
Example for ElasticSearch 2.0 as the datasource:
[server] port = 8080 dsname = elasticsearch dshost = http://127.0.0.1:9200 dscontainer = logstack
- Start your datastore server
- Execute: go get github.com/prsolucoes/logstack
- Execute: cd $GOPATH/src/github.com/prsolucoes/logstack
- Create config file (config.ini) based on some above example
- Execute: make deps
- Execute: make install
- Execute: logstack -f=config.ini
- Open in your browser: http://localhost:8080
- List(GET): http://localhost:8080/api/log/list?token=[put-your-token-here]&message=[message-optional]&created_at=[start-date-log-optional]
- Add(POST): http://localhost:8080/api/log/add [token, type, message]
- DeleteAll(GET): http://localhost:8080/api/log/deleteAll [token]
- StatsByType(GET): http://localhost:8080/api/log/statsByType [token]
- token = your session token, because you can see only logs from specific session token.
- type = can be any knew type of level log (error, fatal, info, warning, trace, debug, verbose, echo, warning, success)
- message = any log message
Command line interface
You can use some make commands to control LogStack service, like start, stop and update from git repository.
- make stop = it will kill current LogStack process
- make update = it will update code from git and install on $GOPATH/bin directory
So if you want start your server for example, you only need call "make start".
Alternative method to Build and Start project
- go build
- ./logstack -f=config.ini
Updates In Real Time
You dont need refresh your browser, everything is updated in real time.
You can leave the stats charts opened in one browser window for example and see the chart being refreshed in real time.