Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-logger-2

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-logger-2

A wrapper on top of winston with log rotation capabilities

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Easy Logger

Wrapper for your logger to do the heavy lifting, so that all you do is write logs just like a simple print-line.

Installation

You can install the Logger package from npm using the following command:

npm install easy-logger-2

Usage

Out of box, the package provides winston logger, with a flavouring on top. You will need to ensure some env properties to be set for this to work exactly as you need. It will still work when you don't set the env properties right, but with default values.

Defaults

ENV Properties

#####

##### LOG_LEVEL can be changed as per environment, like error,debug,info etc.

#####


## LOGGER PROPS { error -> info -> debug } --rtdf = file rotation date format --maxfilesize in mb
LOG_LEVEL     = debug
LOG_LIFE_DAYS = 15
LOG_MAX_FSIZE = 5
LOG_FILE_RTDF = YYYYMMDD
DATE_FORMAT   = YYYY-MM-DD HH:mm:ss
FILE_API_LOG  = helloworld-api.log
FILE_APP_LOG  = helloworld-app.log

Example

Logs

const logger = require('easy-logger-2');

logger.warn(`Warning Message`);
logger.error('Error Message`);
logger.debug(`Debug Message`);
logger.info(`Info Message`);

Note

This package will help you streamline API logs across your application.

Keywords

FAQs

Package last updated on 04 Aug 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc