winston-chatwork-webhook-transport

0.0.7 • Public • Published

Node.js CI

winston-chatwork-webhook-transport

  • node用のloggerであるwinstonについてChatworkへの投稿を行うためのtransport

Installation

npm install winston winston-chatwork-webhook-transport

Usage

Set up with transports

import * as dotenv from "dotenv";
import winston from "winston";
import { ChatworkHook } from "winston-chatwork-webhook-transport";

const logger = winston.createLogger({
  level: "info",
  format: winston.format.combine(
    winston.format.timestamp(),
    winston.format.splat(),
    winston.format.json()
  ),
  transports: [
    new winston.transports.Console({ level: "debug" }),
    new ChatworkHook({
      level: "error",
      roomid: process.env.roomid,
      token: process.env.token,
    }),
  ],
});

logger.debug("Debug Message");
logger.info("Info Message");
logger.warn("Warn Message");
logger.error("Error Message");

Package Sidebar

Install

npm i winston-chatwork-webhook-transport

Weekly Downloads

0

Version

0.0.7

License

MIT

Unpacked Size

4.67 kB

Total Files

4

Last publish

Collaborators

  • nts-sys