Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/luis-codex/lc-elysia-logger

Efficient Logging Middleware Designed for Elysia Web Framework
https://github.com/luis-codex/lc-elysia-logger

bun bunjs elysia elysiajs logger logging middleware web

Last synced: 15 days ago
JSON representation

Efficient Logging Middleware Designed for Elysia Web Framework

Awesome Lists containing this project

README

        

# lc-elysia-logger

## Installation

```bash
bun add lc-elysia-logger
```

## Usage

```js
import { lcLogger } from 'lc-elysia-logger';
import { Elysia } from 'elysia';

const app = new Elysia()
.use(lcLogger())
.group('lc-elysia-logger', (api) =>
api
.get('/', () => ({ message: 'API' }))
.post('/', () => ({ message: 'API' }))
.put('/', () => ({ message: 'API' }))
.delete('/', () => ({ message: 'API' }))
.patch('/', () => ({ message: 'API' }))
.options('/', () => ({ message: 'API' }))
.head('/', () => ({ message: 'API' }))
)
.listen(3000);

console.log(` - API is running at ${app.server?.hostname}:${app.server?.port}`);

```

## Result

![Result logger](https://github.com/luis-tenorio-code/lc-elysia-logger/blob/master/example.png?raw=true)