Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/monlog
MongoDB log server with human-friendly query language support
https://github.com/segment-boneyard/monlog
Last synced: about 5 hours ago
JSON representation
MongoDB log server with human-friendly query language support
- Host: GitHub
- URL: https://github.com/segment-boneyard/monlog
- Owner: segment-boneyard
- Created: 2014-02-05T22:14:05.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-11T03:04:13.000Z (almost 11 years ago)
- Last Synced: 2024-10-16T07:31:52.165Z (about 1 month ago)
- Language: JavaScript
- Size: 290 KB
- Stars: 12
- Watchers: 41
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# monlog
MongoDB log server supporting [monquery](https://github.com/visionmedia/node-monquery)
for human-friendly queries, and regular JSON queries. Built with [Koa](http://koajs.com) and requires node 0.11.x.You may want to use the [monlog-cli](https://github.com/segmentio/monlog-cli) as well.
## Installation
```
$ npm install -g monlog
```## Usage
```
Usage: monlog [options]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --port port number [3000]```
## API
### POST /
Create a log entry, expects:
- `timestamp`
- `hostname`
- `message`
- `level`
- `type`### GET /
Search with [monquery](https://github.com/visionmedia/node-monquery) support,
via the `?query` parameter:```
GET /?query=level:error+AND+type:upload
```Limit responses with `?limit`:
```
GET /?limit=1 level:error
```Filter responses with `?filter`:
```
GET /?limit=1&fields=type,level,hostname level:error
```Specify a starting date with the `?from` timestamp:
```
GET /?limit=5&from=1392084587557
```## GET /stats
Respond with log stats:
```
{
"count": 2041999
}
```## Capping the logs
To turn your `monlog` "logs" collection into a capped collection
run the following command in mongo's shell, where `size` here is
20gb:```js
db.runCommand({ convertToCapped: 'logs', size: 21474836480 });
```# License
MIT