1.0.52 • Published 5 years ago

console-syslog v1.0.52

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

console-syslog

A console & syslog simple logger.

Version npmnpm
Downloads

NPM

Installation

Installing npm (node package manager)

  $ curl http://npmjs.org/install.sh | sh

Installing console-syslog

  $ npm install console-syslog

Usage

To use this logger, you simply need to require it passing your options to configure it:

let options = {
  app_name: "your app name",
  device: "your app device",
  syslog_host: "a syslog host",
  syslog_port: "a syslog port",
  hostname: "your app host",
  timestamp: true
}
let logger = require("console-syslog")(options);

logger("info", "This is the message", { statusCode: 200, foo: "bar" })

An aditional "priority" field is added and setted to the log level.

This syslog doesn´t accept all of the RFC 5424 compliant parameters, so use it on your own risk. The parameters accepted on the options are as follows:

  • app_name: The app that generates the logs. (default: "default app")
  • device: The device the app is running on. (default: "default device")
  • syslog_host: The syslog server host to send syslog messages. (default: "localhost")
  • syslog_port: The syslog server port to send syslog messages. (default: 5556)
  • hostname: Your app host. (default: "localhost")
  • timestamp: Set to true to print a timestamp with format YYYY-MM-DDTHH:mm:ss. (default: true)
1.0.52

5 years ago

1.0.51

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago