logger-npm-package-softtech
v1.1.2
Published
logger node package.
Downloads
4
Readme
Installation
Step 1: Install the package using npm:
npm install logger-npm-package-softtech
Usage
Step 2: Require the logger package in your Node.js application:
const logger = require('logger-npm-package-softtech');
Step 3: Use the middleware provided by the logger package to log requests and responses:
app.use(logger.newLogMiddleware);
Step 4: Configure your MongoDB URL in a .env
file:
MONGODB_URL=your_DB_url
Example
Here's an example of how to use the logger package in a simple Node.js application:
const express = require('express');
const logger = require('logger-npm-package-softtech');
const app = express();
// Use the logger middleware to log requests and responses
app.use(logger.newLogMiddleware);
// Configure MongoDB URL in .env file
// Define routes and other middleware as needed
app.listen(3000, () => {
console.log('Server is running on port 3000');
});