More Premium Hugo Themes Premium Nuxt Themes

Nuxt Winston Log

Nuxt module for logging SSR errors using winston

Nuxt Winston Log

Nuxt module for logging SSR errors using winston

Author Avatar Theme by aaronransley
Github Stars Github Stars: 46
Last Commit Last Commit: Mar 11, 2022 -
First Commit Created: Dec 18, 2023 -
Nuxt Winston Log screenshot

Overview

The nuxt-winston-log is a module for Nuxt 2.x projects that adds winston-powered logging to your application. It captures SSR errors and access logs for serverMiddleware endpoints and pages in your Nuxt app. The logs are output in JSON Lines format by default.

Features

  • Captures error level and info level logs
  • Includes additional metadata pulled from the Node.js request object
  • Output logs in JSON Lines format by default

Installation

To install the nuxt-winston-log module, follow these steps:

  1. Install the npm package:

    npm install nuxt-winston-log
    
  2. Edit your nuxt.config.js file to add the module:

    modules: [
      'nuxt-winston-log'
    ]
    
  3. Customize the module options using the winstonLog key in your nuxt.config.js file. See the Usage section for details on available options.

Summary

The nuxt-winston-log module is a useful addition to Nuxt 2.x projects that provides winston-powered logging functionality. It captures error and info level logs and includes additional metadata from the Node.js request object. The module is easy to install and configure, making it a convenient choice for adding logging to your Nuxt application.