2018-01-31 23:35:54 +00:00
---
layout: page
title: Monitoring Logs
---
2018-12-16 04:41:58 +00:00
## Monitoring Logs
2020-05-31 04:39:27 +00:00
ENiGMA½ does not produce much to stdout. Logs are produced by [Bunyan ](https://github.com/trentm/node-bunyan ) which outputs each entry as a JSON object.
2018-01-31 23:35:54 +00:00
Start by installing bunyan and making it available on your path:
2018-11-23 18:05:51 +00:00
```bash
npm install bunyan -g
```
2020-05-31 04:39:27 +00:00
or via Yarn:
2018-11-23 18:05:51 +00:00
```bash
yarn global add bunyan
```
2020-05-31 04:39:27 +00:00
2018-01-31 23:35:54 +00:00
To tail logs in a colorized and pretty format, issue the following command:
2018-11-23 18:05:51 +00:00
```bash
tail -F /path/to/enigma-bbs/logs/enigma-bbs.log | bunyan
```
2018-01-31 23:35:54 +00:00
2018-12-16 04:41:58 +00:00
See `bunyan --help` for more information on what you can do!
### Example
Logs _without_ Bunyan:
```bash
tail -F /path/to/enigma-bbs/logs/enigma-bbs.log
{"name":"ENiGMA½ BBS","hostname":"nu-dev","pid":25002,"level":30,"eventName":"updateFileAreaStats","action":{"type":"method","location":"core/file_base_area.js","what":"updateAreaStatsScheduledEvent","args":[]},"reason":"Schedule","msg":"Executing scheduled event action...","time":"2018-12-15T16:00:00.001Z","v":0}
{"name":"ENiGMA½ BBS","hostname":"nu-dev","pid":25002,"level":30,"module":"FTN BSO","msg":"Performing scheduled message import/toss...","time":"2018-12-15T16:00:00.002Z","v":0}
{"name":"ENiGMA½ BBS","hostname":"nu-dev","pid":25002,"level":30,"module":"FTN BSO","msg":"Performing scheduled message import/toss...","time":"2018-12-15T16:30:00.008Z","v":0}
```
Oof!
Logs _with_ Bunyan:
```bash
tail -F /path/to/enigma-bbs/logs/enigma-bbs.log | bunyan
[2018-12-15T16:00:00.001Z] INFO: ENiGMA½ BBS/25002 on nu-dev: Executing scheduled event action... (eventName=updateFileAreaStats, reason=Schedule)
action: {
"type": "method",
"location": "core/file_base_area.js",
"what": "updateAreaStatsScheduledEvent",
"args": []
}
[2018-12-15T16:00:00.002Z] INFO: ENiGMA½ BBS/25002 on nu-dev: Performing scheduled message import/toss... (module="FTN BSO")
[2018-12-15T16:30:00.008Z] INFO: ENiGMA½ BBS/25002 on nu-dev: Performing scheduled message import/toss... (module="FTN BSO")
```
Much better!