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:
Install the npm package:
npm install nuxt-winston-logEdit your
nuxt.config.jsfile to add the module:modules: [ 'nuxt-winston-log' ]Customize the module options using the
winstonLogkey in yournuxt.config.jsfile. 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.