0.1.3 • Published 2 months ago

@grotto/logysia v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

Logysia

A logging middleware for the Elysia web framework. Developed with Bun.

Installation

bun add @grotto/logysia

Usage/Examples

import { logger } from '@grotto/logysia';
import { Elysia } from "elysia";


if (import.meta.main) {
    const app = new Elysia()
        // These are the default options. You do not need to copy this down
        .use(logger({ 
            logIP: false,
            writer: {
                write(msg: string) {
                  console.log(msg)
                }
            }
        }))
        .get("/", ctx => "Hello, world!");
}

Configuration

OptionDescription
logIPDisplays the incoming IP Address based on the XFF Header
writerUses write function to send the log. Defaults to the console

Result

Alt text

Logysia also supports printing when there are errors in your application.

0.1.3

2 months ago

0.1.0

5 months ago

0.1.1

5 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

9 months ago

0.0.1

9 months ago