Skip to content

Commit 8f239d2

Browse files
committed
Tidy up initial documentation
1 parent fc7379e commit 8f239d2

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2013-2021 Ghost Foundation
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.
20+

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
# Elasticsearch Bunyan
1+
# Bunyan Rotating Filestream
22

33
## Install
44

5-
`npm install elasticsearch-bunyan --save`
5+
`npm install @tryghost/bunyan-rotating-filestream --save`
66

77
or
88

9-
`yarn add elasticsearch-bunyan`
9+
`yarn add @tryghost/bunyan-rotating-filestream`
1010

1111

1212
## Usage
1313

14+
Create a bunyan logger using the stream:
15+
16+
```js
17+
var log = bunyan.createLogger({
18+
name: 'foo',
19+
streams: [{
20+
stream: new RotatingFileStream({
21+
path: '/var/log/foo.log',
22+
period: '1d', // daily rotation
23+
totalFiles: 10, // keep up to 10 back copies
24+
rotateExisting: true, // Give ourselves a clean file when we start up, based on period
25+
threshold: '10m', // Rotate log files larger than 10 megabytes
26+
totalSize: '20m', // Don't keep more than 20mb of archived log files
27+
gzip: true // Compress the archive log files to save space
28+
})
29+
}]
30+
});
31+
```
32+
33+
Other options include `startNewFile` to always open a new file on start-up.
1434

1535
## Develop
1636

1737
1. `git clone` this repo & `cd` into it as usual
1838
2. Run `yarn` to install top-level dependencies.
1939

20-
21-
## Run
22-
23-
- `yarn dev`
24-
25-
2640
## Test
2741

2842
- `yarn lint` run just eslint
@@ -36,6 +50,4 @@ or
3650

3751
# Copyright & License
3852

39-
Copyright (c) 2021 Ghost Foundation. All rights reserved.
40-
41-
This code is considered closed-source and not for distribution. There is no opensource license associated with this project.
53+
Copyright (c) 2013-2021 Ghost Foundation - Released under the [MIT license](LICENSE).

0 commit comments

Comments
 (0)