Data & Services

Logging

Write structured JSON Lines logs with levels and contextual data.

Beta · v0.2.0Lanjit APIs may change before the stable release. Review the release notes and upgrade guide before updating.

The log binding writes one JSON object per line to storage/logs/lanjit.log. Use debug, info, warning, or error, and configure the minimum level with LOG_LEVEL. File rotation, retention, remote transports, and automatic secret redaction are not included in 0.2.0.

Examples

await app.make('log').info('Invoice dibuat', {
  invoiceId: 10,
  userId: request.user.id,
});

await app.make('log').warning('Percobaan login gagal', {
  email: credentials.email,
});
{"timestamp":"2026-08-29T07:00:00.000Z","level":"info","message":"Invoice dibuat","context":{"invoiceId":10}}
LOG_LEVEL=info
Edit this page on GitHub

Type to search all documentation.