https://github.com/arb/good-file
File broadcasting for Good process monitor
https://github.com/arb/good-file
Last synced: 11 days ago
JSON representation
File broadcasting for Good process monitor
- Host: GitHub
- URL: https://github.com/arb/good-file
- Owner: arb
- License: other
- Created: 2014-10-02T21:54:18.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-12T16:10:41.000Z (about 10 years ago)
- Last Synced: 2025-01-03T07:23:52.772Z (over 1 year ago)
- Size: 68.4 KB
- Stars: 0
- Watchers: 2
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# good-file
File logging module for [good](https://github.com/hapijs/good) process monitoring.
 
Lead Maintainer: [Adam Bretz](https://github.com/arb)
## Usage
`good-file` is a [good-reporter](https://github.com/hapijs/good-reporter) implementation to write hapi server events to log files.
## Good File
### new GoodFile (path, [options])
creates a new GoodFile object with the following arguments
- `path` - (required) location to write log files. "./path/" creates {timestamp} file in "./path/". "./path/log_name" creates "log_name" in "./path/". All log files created with `good-file` have three digit numerical extensions that are padded with "0"s ("1410562652544.005" or "log_name.005"). If "./path/" has any existing log files when this module is `start()`ed, the next number in sequence will be used.
- `[options]` - optional arguments object
- `[events]` - an object of key value paris. Defaults to `{ request: '*', log: '*' }`.
- `key` - one of ("request", "log", "error", or "ops") indicating the hapi event to subscribe to
- `value` - an array of tags to filter incomming events. An empty array indicates no filtering.
- `[maxFileSize]` - how large a single log file can grow before a new one is created. Defaults to `Infinity`
### GoodFile Methods
`good-file` implements the [good-reporter](https://github.com/hapijs/good-reporter) interface as has no additional public methods.