Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

syslogsfiles-winston

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

syslogsfiles-winston

Generate logs files with syslogs format (local).

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Syslogs Winston

SyslogsFiles-Winston is a simple transports for winston, principal features:

  • Create syslogs format files
  • Without syslog server
  • Magic

Installation

Syslogs files requires Node.js v4+ to run.

Install the dependencies and start the server.

$ cd yourProject
$ npm install syslogsfiles-winston --save

How to use?

const winston = require('winston');
const Syslogs = require('syslogsfiles-winston');

const logger = new winston.Logger({
  transports: [
    new Syslogs({
      files: {
        filename: 'yourfilename.log',
        path: './logs',
        maxSize: '5mb',
      },
      sysConfig: {
        facility: 'local4',
        severity: 'error',
        host: 'localhost',
        appName: 'sudo',
        pid: '123',
        date: new Date(Date()),
      },
    }),
  ],
});

const myError = new Error();
myError.message = 'Error message';
myError.name = 'ERROR_NAME';

logger.error(myError.message);

Logs example file

error: <163>1 2018-02-12T10:08:41.00+01:00 localhost sudo 123 - - Error message
error: <163>1 2018-02-12T10:08:41.00+01:00 google.com sudo 123 - - Error google

Keywords

Syslogs

FAQs

Package last updated on 12 Feb 2018

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