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

gelf-file

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gelf-file

Gelf formatted log files.

  • 1.8.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gelf-file

NPM

Known Vulnerabilities JavaScript Style Guide Commitizen friendly Build Status Coverage Status

Gelf formatted log files.

Installation

npm install gelf-file

Arguments

  • file String: The path for the log file.
  • opts Object:
    • logLevel : The log level for the application.
    • timestamp The format for the timestamp. See time-stamp
  • args Object : An object containing parameters that should be added to each log entry.

Log Levels

Mirror that of syslog:

  • 0 EMERGENCY system unusable
  • 1 ALERT immediate action required
  • 2 CRITICAL condition critical
  • 3 ERROR condition error
  • 4 WARNING condition warning
  • 5 NOTICE condition normal, but significant
  • 6 INFO a purely informational message
  • 7 DEBUG debugging information

Usage

const logger = require('gelf-file')('./app.log', {logLevel: 'WARNING'}, {app: 'my-app'});
logger.log('DEBUG', 'started app');

API

Parameters

  • logLevel String - The desired log level. Valid values are listed in the log level list above.
  • message String - The log message.
  • tags Object - Additional information to store with the log message.

Functions

  • log(logLevel, message, tags) - Creates a log entry for the desired log level.
  • emergency(message, tags) - Creates an emergency log entry.
  • alert(message, tags) - Creates an alert log entry.
  • critical(message, tags) - Creates an critical log entry.
  • error(message, tags) - Creates an error log entry.
  • warning(message, tags) - Creates an warning log entry.
  • notice(message, tags) - Creates an notice log entry.
  • info(message, tags) - Creates an info log entry.
  • debug(message, tags) - Creates an debug log entry.

Inspiration

This project was inspired by log

Keywords

FAQs

Package last updated on 12 Sep 2020

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