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

log-file-write

v2.2.0

Published

Loggers are used by applications and runtime components to capture message and trace events. Log handlers write log record objects to output devices like log files

Downloads

194

Readme

log-file-write

Loggers are used by applications and runtime components to capture message and trace events. Log handlers write log record objects to output devices like log files

this plug use only work for node backend!!!!!

Features

  • [x] (new)Slack webhook support
  • [x] change timezone
  • [x] customize logfile name
  • [x] control console log
  • [x] pretty loggers

Installation

Install via NPM:

npm install log-file-write
const {
  SetUserOptions,
  Info,
  Debug,
  Trace,
  Warn,
  Error,
  Fatal,
  Log,
} = require("log-file-write");

SetUserOptions({
  timeZone: "Asia/Colombo",
  folderPath: "./logs",
  dateBasedFileNaming: true,
  fileName: "Global_Logs",
  fileNamePrefix: "Logs_",
  fileNameSuffix: "file",
  fileNameExtension: ".log",
  dateFormat: "YYYY-M-DD",
  timeFormat: "HH:mm:ss.SSS",
  logLevel: "deb",
  onlyFileLogging: false, // if you want to print content to console
  slackWebhookUrl: "", //https://hooks.slack.com/services/T04K
  logsDeletePeriodInDays: 60, // delete log files after 60 days default is 60
});

// // Log a simple error message
Info("Some informational log message");

// // // Log an error message with service and method names
// Error('Something has failed!', 'Some service', 'Some method');

Success("Success message 1", "Success service", "Success method");
Debug("Debug message 1", "Debug service", "Debug method");
Trace("Trace message 1", "Trace service", "Trace method");
Info("Info message 1", "Info service", "Info method");
Warn("Warning message 1", "Warn service", "warn method");
Error("Error message 1", "Error service", "Error method");
Fatal("Fatal message 1", "Fatal service", "Fatal method");
Log("debug", "Debug message 2", "S1", "M1", { baz: "foo" }, () => {
  console.log("Debug message 2");
});

// Log an fatal error message with service and method names and error object
Fatal("Something has failed!", "Some service", "Some method", {
  bar: "foo",
});

Info("Something has failed!", null, null, null, function () {
  // Do something
  console.log("Messages have been logged");
});

All Time Zone

📎

Time zone