Skip to content

sanojkrishnan/loggerdet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

loggerdet

A simple and flexible Express middleware that logs HTTP requests to the console and/or a file. Ideal for debugging, monitoring, and tracking incoming traffic in your Express.js apps.


πŸ“¦ Installation

npm install loggerdet

## ✨ What This Module Provides

This package exports **two independent middleware functions** that you can use based on your logging needs:

### 1. `requestLogger(options)`

- Logs request details (method, URL, IP, timestamp) to the **console**
- Useful for quick development/debugging
- Example log:


### 2. `logLogger(options)`

- Logs the same request details into a **log file (`log.txt`)**
- Ideal for storing logs for audit or production
- File log output:


### Whats new!

## removed a function for port listening which was not not a good feature
## updated to more stable and well memory efficient code for better performance



------------
You can use either one **or all together** in your Express app like this:

```js
const loggerdet = require("loggerdet");

app.use(loggerdet.requestLogger()); // for console
app.use(loggerdet.logLogger());     // for file logging


## πŸ§‘β€πŸ’» Author

**SanojKrishnan M**

- πŸ’Ό MERN Stack Developer
- 🌐 [GitHub Profile](https://github.com/sanojkrishnan)
- πŸ“§ Email: [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published