npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pino-daily-rotate-file

v0.0.1

Published

Pino Daily Log Rotate File

Downloads

567

Readme

pino-daily-rotate-file

NPM version

NPM

A daily log rotating pino package which logs to a rotating file. Logs can be rotated based on a size limit, date and old logs can be removed based on count or elapsed days.

Install

npm install pino-daily-rotate-file
  • Ready to use pino rotating file logger. Just install and use.

Options

You can provide the below keys in as your environment variables,

  • If any env variable is not provided, their default values are used.

| Environment Variables | values | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | LOGGING_LEVEL | You can mention your log level, valid values are debug, info, error, warn, fatal Default: info | | LOGGING_PATH | Give a path, where log file should be created. Default: current directory where process is running | | MAX_LOGS | Max number of logs to keep. If not set, it won't remove past logs. It uses its own log audit file to keep track of the log files in a json format. It won't delete any file not contained in it. It can be a number of files or number of days. If using days, add 'd' as the suffix. e.g., '10d' for 10 days. If no value is provide, old log file won't be deleted | | EXTENSION | The extension of the log file generated Default: ".log" | | DATE_FORMAT | Use 'Y' for full year, 'M' for month, 'D' for day, 'H' for hour, 'm' for minutes, 's' for seconds . If using 'date' frequency, it is used to trigger file change when the string representation changes. It will be used to replace %DATE% in the filename. All replacements are numeric only. Default: "YYYY-MM_DD" | | UTC | Use UTC time for date in filename Default: false | | LOGGING_INTERVAL | How often to rotate. Options are 'daily' for daily rotation, 'date' based on date_format, '[1-12]h' to rotate every 1-12 hours, '[1-30]m' to rotate every 1-30 minutes. Default: "daily" | | APP_NAME | Name of the log file along the date string. Eg: "YourServiceName-YYYY-MM-DD.log" Default: "File" | | LOGGING_FILE_SIZE | Max size of the file after which it will rotate. It can be combined with frequency or date format. The size units are 'k', 'm' and 'g'. Units need to directly follow a number e.g. 1g, 100m, 20k. Default: '1g' |

Usage

var logger = require("pino-daily-rotate-file");

logger.info("Hello World!");

ES6

import logger from "pino-daily-rotate-file";

logger.info("Hello World!");

LICENSE

MIT

AUTHOR: Nikhil Bharadwaj