Nexlog: A lightweight logging library for Next.js

nexlog: A Lightweight, Zero-Dependency Logging Library for Next.js

Hello Vercel community! I’m excited to share nexlog, a logging library I’ve developed specifically for Next.js applications.

Key Features

  • Works seamlessly with both RSC and client components
  • Zero external dependencies
  • Full TypeScript support
  • Environment-aware (Server, Browser, Edge)
  • Customizable log levels
  • Colored console output for server environments
  • Lightweight and easy to use

Why nexlog?

I created nexlog to address the need for a simple, efficient logging solution in the Next.js ecosystem. It’s designed to be flexible, performant, and easy to integrate, whether you’re working with server-side rendering, client-side components, or edge functions.

Quick Start

Install nexlog:

npm install nexlog

Configure Next.js (in next.config.js or next.config.mjs):

/** @type {import('next').NextConfig} */
const nextConfig = {
  transpilePackages: ["nexlog"],
};

export default nextConfig;

Use in your components:

import logger from 'nexlog';

logger.info('This is an info message');
logger.warn('This is a warning', { additionalInfo: 'Some extra data' });

GitHub Repository

For more details, examples, and to contribute: https://github.com/Arakiss/nexlog

I’d love to hear your thoughts and feedback. Feel free to try it out and let me know what you think!

4 Likes

Nice! I’ll give it a go on my projects. :smile: Will circle back if I have any feedback or comments!

I’ll also share it internally. Thank you!!

1 Like

Thanks pawlean! Really appreciate you giving it a try and sharing it around. I’m looking forward to any feedback you might have. If you need any help, just let me know. Cheers!