Skip to content

PunGrumpy/logixlysia

Repository files navigation

🦊 Logixlysia

Logixlysia is a logging library for ElysiaJS Screenshot of Logixlysia

πŸ“© Installation

bun add logixlysia

πŸ“ Usage

import { Elysia } from 'elysia'
import { logixlysia } from 'logixlysia'

const app = new Elysia({
  name: 'Logixlysia Example'
}).use(
  logixlysia({
    config: {
      ip: true,
      customLogFormat:
        '🦊 {now} {level} {duration} {method} {pathname} {status} {message} {ip}',
      logFilter: {
        level: ['ERROR', 'WARNING'],
        status: [500, 404],
        method: 'GET'
      }
    }
  })
)

app.listen(3000)

πŸ“š Documentation

Options

Option Type Description Default
ip boolean Display the incoming IP address based on the X-Forwarded-For header false
customLogMessage string Custom log message to display 🦊 {now} {level} {duration} {method} {pathname} {status} {message} {ip}
logFilter object Filter the logs based on the level, method, and status null

πŸ“„ License

Licensed under the MIT License.