4.1.2 • Published 5 months ago

logixlysia v4.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

📩 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)

!NOTE You can discover more about example in the example directory.

!TIP Also, you can play my example with Swagger UI on http://localhost:3000/swagger.

📚 Documentation

Options

OptionTypeDescriptionDefault
showStartupMessagebooleanDisplay the startup messagetrue
startupMessageFormat"banner" | "simple"Choose the startup message format"banner"
timestampobjectDisplay the timestamp in the logs{ translateTime: 'yyyy-mm-dd HH:MM:ss' }
ipbooleanDisplay the incoming IP address based on the X-Forwarded-For headerfalse
customLogMessagestringCustom log message to display🦊 {now} {level} {duration} {method} {pathname} {status} {message} {ip}
logFilterobjectFilter the logs based on the level, method, and statusnull
logFilePathstringPath to the log file./logs/elysia.log

Custom Log Message

PlaceholderDescription
{now}Current date and time in YYYY-MM-DD HH:mm:ss format
{level}Log level (INFO, WARNING, ERROR)
{duration}Request duration in milliseconds
{method}Request method (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
{pathname}Request pathname
{status}Response status code
{message}Custom message
{ip}Incoming IP address
{epoch}Current date and time in Unix epoch format (seconds since January 1, 1970

📄 License

Licensed under the MIT License.

4.1.0

6 months ago

4.1.2

5 months ago

4.1.1

6 months ago

4.0.0

9 months ago

3.6.2

10 months ago

3.7.0

10 months ago

3.4.0

1 year ago

3.6.1

11 months ago

3.6.0

12 months ago

3.3.1

1 year ago

3.3.0

1 year ago

3.5.0

1 year ago

3.3.2

1 year ago

3.2.0

1 year ago

3.0.2

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.2

2 years ago

2.0.1

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

2.0.0

2 years ago

1.1.4-beta.0

2 years ago

1.1.2-beta.3

2 years ago

1.1.2-beta.2

2 years ago

1.1.2-beta.0

2 years ago

1.1.2

2 years ago

1.1.1-beta.2

2 years ago

1.1.1-beta.1

2 years ago

1.1.1-beta.0

2 years ago

1.1.1

2 years ago

1.1.0-beta.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.1

2 years ago

1.0.0

2 years ago

0.0.2-alpha.2.4

2 years ago

0.0.2-alpha.2.3

2 years ago

0.0.2-alpha.2.2

2 years ago

0.0.2-alpha.2.1

2 years ago

0.0.2-alpha.2

2 years ago

0.0.2-alpha.1

2 years ago

0.0.2-alpha.0

2 years ago

0.0.2

2 years ago