1.4.0 • Published 3 years ago

winston-prisma-transport v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

winston-prisma-transport


A Prisma logger for the winston logging library

Installation

  1. Ensure that you have prisma set up in your project. See the Prisma docs for setup.
  2. Create a table for your logs e.g.
model Log {
  id    String @id @default(cuid())
  time  String
  error String
  site  String
  level String
}
  1. Install winston-prisma-transport:
$ npm winston-prisma-transport
$ yarn add winston-prisma-transport
  1. Usage:
const { createLogger } = require("winston");
const PrismaTransport = require("winston-prisma-transport");

const logger = createLogger({
  transports: [
    new PrismaTransport({
      table: "log",
      site: "anothersite.com",
    }),
  ],
});

module.exports = logger;
  1. Logging
logger.log('info', 'message', {});
1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago