8000 GitHub - Luis0Antonio/logysia: Logysia is a logging library for the Elysia Web Framework for Bun (JS/TS).
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Luis0Antonio/logysia

8000
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!")
        .listen(3000);
}

Configuration

Option Description
logIP Displays the incoming IP Address based on the XFF Header
writer Uses write function to send the log. Defaults to the console

Result

Alt text

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

About

Logysia is a logging library for the Elysia Web Framework for Bun (JS/TS).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%
0