New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nogger

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nogger

nogger - the node.js logger

  • 0.3.0
  • Source
  • npm
  • Socket score

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

nogger - the node.js logger

Build Status

Simple node.js logger to log to logfile. With the streaming interface it is possible to watch the livelogs.

Getting Started

Install the module with: npm install nogger

var nogger = require('nogger');
var log = nogger.getLogger();

or short

var log = require('nogger').getLogger();

Documentation

Logger usage

You can use predefined logging functions or defined your own level of logging

log.debug("hey ho debug!");
log.info("hey ho info!");
log.warn("hey ho warning!");
log.error("hey ho error!");

log("connection","hey ho connection!"); // custom level

configuration

To configure the Logger you can call setConfig

nogger.setConfig({
  path: './logs/', // path where log files are saved
  logOnly: [ // log only these types to the logfiles
    'error',
    'warn',
    'connection'
  ],
  rotate: "daily", // interval to change the logfile
  timezoneOffset: -60 // to jump to the next logfile on correct hour
  streamEnabled: true, // enable the awesome frontend for live logging view
  maxLogLength: 250, // maximum logging message length before it is truncated
  password: "a", // password for the log stream frontend
  port: 7076, // port for the log stream frontend
  styles: { // you can define how the log in the frontend looks like by passing css styles - define your custom log levels here!
    "debug": {
      color: "#c2d5ff",
      "font-size": "0.9em"
    },
    "info": {
      color: "#ffffff",
      "font-size": "0.8em"
    },
    "warn": {
      color: "#ff5f00",
      "font-size": "1em"
    },
    "error": { 
      color: "#ea1c00",
      "font-size": "1.1em"
    }
  },
  overwriteConsole: true // if you want you can turn off overwriting the default console.log
}

Examples

To see the demo download the module with npm install nogger and run node lib/demo then go to localhost:7076 and use the default password "change-this" to log in.

screenshot

Todo

Streams for writing and reading log messages and files. Help is welcome!

License

Copyright (c) 2014 Paul Em. Licensed under the MIT license.

Keywords

FAQs

Package last updated on 26 Jan 2014

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