Unified logs as stream.
Sherlog CLI is bundled with Prisma. Feel free to consume the stream with any other tool or programming language of your preference.
Demo: https://sherlog.sh
OS X & Linux node >= v10.15.0
:
npm install -g @sherlog/cli
You can use the --help option to get more details about options and commands
Usage: sherlog [options] [command]
Options:
-v, --version print version
-h, --help display help for command
Commands:
init [options] initializes the project
test [options] validate your config schema
start [options] start the server
help [command] display help for command
The following command will initialize your project and create a basic .sherlog
config file.
sherlog init
{
"hostname": "",
"files": [
{
"metric": "",
"file": "",
"timezone": ""
}
]
}
hostname
: default to your server hostname.backpressure
: the interval in milliseconds between each websocket message sent (default:1000
).chunks
: max items stored in buffer for each metric chunk (default:1
).compression
: uses pako to compress messages sent over to Prisma. Set tofalse
if you wish to consume the stream with a different tool (default:true
).files
: an array of services to monitor. The following options can be configured for each file.metric
: supported metricsapache2|monolog|mysql|nginx|phpfpm|redis
file
: the absolute path to your log file.eventType
: apache2 and/or nginx requires this property to be set to one of the followinghttp|error
.timezone
: IANA time zone in which your logs are stored (e.g UTC, America/New York, etc),fromBeginning
: set to true if you wish to read files from the beginning (default:false
).
{
"hostname": "192.168.10.1",
"backpressure": 1000,
"chunks": 500,
"compression": true,
"files": [{
"metric": "nginx",
"file": "path/to/nginx/access.log",
"eventType": "http",
"timezone": "UTC",
"fromBeginning": true
},
{
"metric": "nginx",
"file": "path/to/nginx/error.log",
"eventType": "error",
"timezone": "UTC",
"fromBeginning": false
}]
}
npm install
npm run dev
npm run docker:build
npm test
Bruce Lampson – @Brucelampson
Distributed under the MIT License. See LICENSE
for more information.
https://github.com/BruceLampson
- Fork it
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request