
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
The ultimate plug-n-play log viewer for Node.js. Go from zero to a production-ready log dashboard in under 2 minutes.
log-vwer is the ultimate plug-and-play toolkit for Node.js developers who are tired of messy console.log statements. It instantly gives you a professional-grade dashboard to view, search, and filter your application logs in real-time.
---
---
Your application logs, beautifully organized & instantly accessible.
log-vwer (The Simple Explanation)Imagine you're building an app. Things go wrong. Users sign up, payments fail, servers crash. How do you see what's happening? You probably use console.log("something happened") everywhere. It’s messy, hard to read, and gets lost in your server terminal.
log-vwer fixes this.
It takes all your logs and puts them into a beautiful, web-based dashboard that you can open in your browser. It's like having a dedicated TV screen just for your app's internal story.
log-vwer is built to be secure. You can easily put your own login system in front of it, so only you and your team can see the logs.Follow these three simple steps to get up and running.
Open your project's terminal and run this command:
npm install log-vwer
This downloads and adds log-vwer to your project.
Go to your main server file (usually app.js or server.js) and add the following code.
// Import the necessary tools
const express = require('express');
const { setupLogger, viewerMiddleware } = require('log-vwer');
// Create your Express app
const app = express();
const PORT = process.env.PORT || 3000;
// This is an async function to make sure we connect to the database *before* starting the server.
async function startServer() {
try {
// === Part 1: Set up the logger ===
// This tells log-vwer how to work.
// We're choosing MongoDB here, but you can also choose 'file' or 'memory'.
const logger = await setupLogger({
serviceName: 'My Awesome E-Commerce App',
store: 'mongodb',
mongoUrl: 'mongodb://localhost:27017/my_app_logs',
});
// === Part 2: Activate the dashboard ===
// This tells your app: "When someone goes to /_logs, first check the password, then show the log dashboard."
app.use('/_logs', myAuthMiddleware, viewerMiddleware(logger));
// === Part 3: Start using your new logger! ===
// Now, instead of console.log, use logger.info, logger.error, etc.
app.get('/', (req, res) => {
logger.info('A user visited the homepage!', {
ipAddress: req.ip,
browser: req.get('User-Agent'),
});
res.send('Welcome! Your visit has been logged. Check it at /_logs');
});
app.get('/error-test', (req, res) => {
try {
// Let's pretend something broke
throw new Error('The payment gateway is offline!');
} catch (error) {
logger.error('CRITICAL: Payment gateway failed!', {
errorMessage: error.message,
errorCode: 'PG-503',
});
res.status(500).send('Oh no! Something broke. The error has been logged.');
}
});
// Start your server only after everything is ready
app.listen(PORT, () => {
logger.warn(`Server is alive on port ${PORT}. Ready to rock!`);
console.log(`Log dashboard is live at: http://localhost:${PORT}/_logs`);
});
} catch (error) {
// If the database connection fails, the server won't start.
console.error("🔴 FATAL ERROR: Could not start server. Is your database running?", error);
process.exit(1);
}
}
// Run the function to start the server!
startServer();
node server.jshttp://localhost:3000. This will create your first "info" log.http://localhost:3000/error-test. This will create your first "error" log.http://localhost:3000/_logs. You'll see your beautiful new dashboard with the logs you just created!log-vwerYou can customize log-vwer to fit your needs perfectly.
setupLogger(options)This is the main function you use to create your logger. It returns a Promise that gives you the logger object.
| Option | What it does | Choices | Example |
|---|---|---|---|
serviceName | (Required) A name for your app. This helps if you have multiple apps logging to the same place. | Any string | 'My API', 'User Authentication Service' |
store | Where you want to save your logs. Defaults to 'memory'. | 'mongodb', 'file', 'memory' | store: 'file' |
mongoUrl | (Required for MongoDB) The full connection address for your MongoDB database. | A MongoDB connection string | 'mongodb+srv://user:pass@cluster.mongodb.net/logs' |
filePath | (Required for File) The path to the file where you want to save logs. | A file path | './logs/app.log' |
logger ObjectOnce you create a logger, it gives you these simple methods to use:
logger.info("User signed up.", { userId: 123 }) - For general information.logger.warn("Cache is getting full.") - For things that aren't errors yet, but might become a problem.logger.error("Database connection failed!", { error: err.message }) - For when things break.logger.debug("Calculating user scores...", { step: 1 }) - For detailed developer-only messages.Each method takes two arguments:
message (string): The main thing you want to say.metadata (object, optional): Any extra data you want to save with the log. This is super useful for debugging.Choosing the right storage is important. Here's a simple guide:
| Storage | Best For... | Why? | Downsides? |
|---|---|---|---|
mongodb | Your live, public website. | It's powerful, can store millions of logs, and never forgets them. You can search it very quickly. | You need to have a MongoDB database running somewhere. |
file | Small projects or servers. | It's very simple. It just creates a text file with all your logs. Easy to read and backup. | Can get slow if you have too many logs. You have to manage the file yourself. |
memory | Developing and testing on your own computer. | It's incredibly fast and requires zero setup. When you stop your app, all logs disappear. | Logs are not saved permanently. They are lost on every restart. |
This is extremely important. Your logs might contain user emails, IP addresses, or other private data. You should never make your log dashboard public.
log-vwer is designed to be a "plugin" for your existing security. Just add your security check (middleware) right before you add viewerMiddleware.
Example with Passport.js (A popular login library):
const passport = require('passport'); // Let's assume you've already set up Passport.js
// This tells the app: "For the /_logs page, first make sure the user is logged in with a valid token.
// If they are, then show them the log dashboard."
app.use(
'/_logs',
passport.authenticate('jwt', { session: false }),
viewerMiddleware(logger)
);
This tool was built with love and lots of coffee by Qitmeer Raza, a passionate developer dedicated to creating tools that make other developers' lives easier.
Find him, connect with him, or see his other projects:
Contributions make the open-source community an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingNewFeature)git commit -m 'Add some AmazingNewFeature')git push origin feature/AmazingNewFeature)This project is licensed under the MIT License. See the LICENSE file for more details.
FAQs
The ultimate plug-n-play log viewer for Node.js. Go from zero to a production-ready log dashboard in under 2 minutes.
We found that log-vwer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.