Request-Logs is a lightweight Node.js application designed to log every HTTP request made to your server. It helps developers monitor and analyze incoming traffic by generating detailed log files for each request. This tool is ideal for debugging, performance monitoring, and security auditing, providing comprehensive insights into your server's activity.
- Logs details of every HTTP request including headers, method, URL, timestamp, and client IP address.
- Generates structured log files for each day, facilitating easy analysis and troubleshooting.
- Simple integration with existing Node.js applications.
- Customizable logging options to suit various use cases.
- Lightweight and efficient, ensuring minimal impact on server performance.
-
Clone the repository:
git clone https://github.com/nerdy-nakul/Request-Logs.git cd Request-Logs
-
Install dependencies:
npm install
To start logging HTTP requests, you can run the application in different modes:
-
Production Mode:
npm start
-
Development Mode (with nodemon):
npm run dev
Make sure to replace server.js
with the filename where your server logic resides.
The application listens for incoming HTTP requests and logs relevant details to a file. Each log entry includes:
- Request Time: Timestamp when the request was received.
- Request Method: HTTP method used (e.g., GET, POST).
- Request Pathname: URL path requested.
- Request Host: Hostname of the server.
- Request IP: IP address of the client making the request.
- Request Headers: Headers sent with the request.
- Query Parameters: Query parameters included in the URL.
Logs are stored in the logs
directory within the project, organized by date (logFile - YYYY-MM-DD.txt
).
We appreciate contributions to make Request-Logs even better! If you have any suggestions, enhancements, or bug fixes, please follow these steps:
-
Create an Issue: First, create an issue to discuss the change you propose. This allows us to coordinate and provide feedback.
-
Fork the Repository: Fork the repository to your own GitHub account.
-
Clone the Repository: Clone the repository to your local machine.
git clone https://github.com/yourusername/Request-Logs.git cd Request-Logs
-
Create a Branch: Create a new branch to work on your feature, enhancement, or bug fix.
git checkout -b feature-name
-
Make Changes: Make your changes, ensuring to follow the coding style and conventions used in the project.
-
Test Your Changes: Run tests if they exist to ensure your changes didn't break anything.
-
Commit Your Changes: Commit your changes and write a descriptive commit message.
git commit -m 'Add feature: describe your changes'
-
Push to the Branch: Push your changes to your forked repository on GitHub.
git push origin feature-name
-
Submit a Pull Request: Go to the original repository on GitHub and create a pull request with your changes.
-
Feedback and Iteration: Participate in the discussion on your pull request. You may need to make further changes based on feedback before your contribution is accepted.
We look forward to your contributions and appreciate your help in improving Request-Logs!
If you have any questions or need clarification on contributing, feel free to open an issue or contact the project maintainers.
For questions or suggestions regarding this project, feel free to open an issue or contact me.