@d-l-i/error-logger
v1.0.1
Published
**Error-Logger** is a simple Node.js package designed to capture and log both **caught** and **uncaught** errors globally, storing them in a file with timestamps for easier debugging and monitoring.
Downloads
16
Readme
Error-Logger
Error-Logger is a simple Node.js package designed to capture and log both caught and uncaught errors globally, storing them in a file with timestamps for easier debugging and monitoring.
Features
- Global Error Handling: Automatically catches and logs uncaught exceptions and unhandled promise rejections.
- Error Logging to File: Logs error messages and stack traces to a local text file.
- Customizable Metadata: Allows you to log additional metadata with each error.
- Timestamped Logs: Includes timestamps in error logs to track when each error occurred.
- Easy Integration: Simple to set up and use in any Node.js application.
Installation
To install the package, run:
npm install @d-l-i/error-logger
usage
const { GlobalFileErrorHandler } = require('@d-l-i/error-logger');
new GlobalFileErrorHandler();