bun add logixlysia
import { Elysia } from 'elysia'
import { logger } from 'logixlysia'
const app = new Elysia({
name: 'Logixlysia Example'
}).use(
logger({
ip: false,
customLogMessage:
'π¦ {now} {level} {duration} {method} {pathname} {status} {message} {ip}'
})
)
app.listen(3000)
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 |
Licensed under the MIT License.