bun add logixlysia
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)
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.