Logging

Structured logging system for VitNode applications

VitNode provides a logging system that allows you to log messages at different levels (debug, warn, error) with structured logs. This is useful for debugging and monitoring your application.

All logs are stored in your database. You can view them in the Debug Panel.

Usage

import { buildRoute } from '@vitnode/core/api/lib/route';
export const testRoute = buildRoute(
  {},
  {
    handler: c => {
      c.get('log').warn('This is a test warn log'); 

      return c.text('test');
    },
  },
);

Variants

c.get('log').debug('This is a test debug log');
c.get('log').warn('This is a test warning log');
c.get('log').error('This is a test error log');

On this page