Skip to content

PunGrumpy/logixlysia

Repository files navigation

🦊 Logixlysia

Logixlysia is a logging library for ElysiaJS Logixlysia

πŸ“© Installation

bun add logixlysia

πŸ“ Usage

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

const app = new Elysia({
  name: 'Logixlysia Example'
}).use(
  logixlysia({
    config: {
      showStartupMessage: true,
      startupMessageFormat: 'simple',
      timestamp: {
        translateTime: 'yyyy-mm-dd HH:MM:ss'
      },
      ip: true,
      logFilePath: './logs/example.log',
      customLogFormat:
        '🦊 {now} {level} {duration} {method} {pathname} {status} {message} {ip} {epoch}',
      logFilter: {
        level: ['ERROR', 'WARNING'],
        status: [500, 404],
        method: 'GET'
      }
    }
  })
)

app.listen(3000)

πŸ“š Documentation

Check out the website for more detailed documentation and examples.

πŸ“„ License

Licensed under the MIT License.