Socket
Socket
Sign inDemoInstall

@tryghost/bunyan-rotating-filestream

Package Overview
Dependencies
1
Maintainers
15
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @tryghost/bunyan-rotating-filestream

## Install


Version published
Weekly downloads
3.4K
increased by10.77%
Maintainers
15
Install size
27.6 kB
Created
Weekly downloads
 

Readme

Source

Bunyan Rotating Filestream

Install

npm install @tryghost/bunyan-rotating-filestream --save

or

yarn add @tryghost/bunyan-rotating-filestream

Usage

Create a bunyan logger using the stream:

    var log = bunyan.createLogger({
        name: 'foo',
        streams: [{
            stream: new RotatingFileStream({
                path: '/var/log/foo.log',
                period: '1d',          // daily rotation
                totalFiles: 10,        // keep up to 10 backup copies
                rotateExisting: true,  // Give ourselves a clean file when we start up, based on period
                threshold: '10m',      // Rotate log files larger than 10 megabytes
                totalSize: '20m',      // Don't keep more than 20mb of archived log files
                gzip: true             // Compress the archive log files to save space
            })
        }]
    });

Other options include startNewFile to always open a new file on start-up.

Develop

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

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Publish

  • yarn ship

Credit

Many thanks to @Rcomian for their work on the original bunyan-rotating-file-stream project, this project borrows lots of the code and all of the ideas in the original.

Copyright (c) 2013-2021 Ghost Foundation - Released under the MIT license.

FAQs

Last updated on 04 Mar 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc