image
Akan.js
English
DocsConventionsReferencesCheatsheet
image
Akan.js
DocsConventionsReferencesCheatsheet
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2026 Akan.js All rights reserved.
System managed bybassman
General
• Authorization
• Schema Design
• Edge Computing
• File Management
• Single Sign-On
• DataList & Enum
Interface
• CRUD
• Endpoint
• Form
Observability
• Logging
• Dependency Injection
• Error Handling
• Metrics
Performance
• Caching
• Image Optimization
• Lazy Loading
• Querying
• Queueing
• Realtime
Development
• Documentation
• Script
• Docker
• Kubernetes
General
• Authorization
• Schema Design
• Edge Computing
• File Management
• Single Sign-On
• DataList & Enum
Interface
• CRUD
• Endpoint
• Form
Observability
• Logging
• Dependency Injection
• Error Handling
• Metrics
Performance
• Caching
• Image Optimization
• Lazy Loading
• Querying
• Queueing
• Realtime
Development
• Documentation
• Script
• Docker
• Kubernetes
Previous
Form
Next
Dependency Injection

Runtime Logging

Akan uses Logger for structured runtime output and AkanApp stores gateway and child process logs as files. Terminal logging stays concise for development, while file logging keeps richer records for later inspection.
Logger API
new Logger(name)
Use named loggers in services, adaptors, scripts, and runtime code.
Terminal level
AKAN_PUBLIC_LOG_LEVEL
Controls what is printed to stdout and stderr.
File level
AKAN_LOG_FILE_LEVEL
Controls what Logger output is written to log files. Defaults to trace.

Using Logger

Create a Logger with a component or service name, then write logs at the level that matches the intent. Add context when the same logger handles several jobs.
Service logging
Use trace or debug for detailed diagnosis, info/log for normal lifecycle events, warn for recoverable issues, and error when an operation failed or needs attention.

Log Levels

Terminal output and file output are intentionally separated. A production server can keep the terminal at info or warn while still writing trace-level Logger records to files.
.env
Terminal
Controlled by AKAN_PUBLIC_LOG_LEVEL. Lower-priority messages are not printed to stdout/stderr.
Files
Controlled by AKAN_LOG_FILE_LEVEL. Defaults to trace so structured Logger messages are preserved even when the terminal is quiet.

File Logging & Rotation

When AkanApp starts, it writes file logs under the app runtime directory by default. Gateway logs and child process logs are separated, and each process key rotates independently by local date and file size.
Default log files
Rotation configuration
The file name format is appName-environment-operationMode-YYYY-MM-DD-processKey-sequence.log. If the date changes, sequence starts again at 0001 for that date. If an app restarts, Akan continues from the next available sequence instead of overwriting old files.

Reading Logs

Start with the gateway log when the app cannot accept traffic, then inspect the child log that handled the request or background job. Child files include stdout and stderr prefixes.
Local lookup
Server lookup
Direct console.log calls from child servers are captured through stdout/stderr pipes. Direct console.log calls from the gateway process are not part of Logger sink capture, so prefer Logger in runtime code.

Operational Checklist

Keep terminal logs readable
Use AKAN_PUBLIC_LOG_LEVEL=info or warn in production and increase it temporarily during live debugging.
Preserve file detail
Keep AKAN_LOG_FILE_LEVEL=trace unless log volume or sensitive fields require a narrower level.
Plan disk usage
AKAN_LOG_MAX_SIZE_MB and AKAN_LOG_MAX_FILES are applied per process key, so replicas multiply the maximum disk usage.
Avoid secrets
Do not log tokens, passwords, database URLs, or private payloads. File logs are designed to last longer than terminal output.
Runtime Logging
Using Logger
Log Levels
File Logging & Rotation
Reading Logs
Operational Checklist