View Logs
The blocklet server logs command is an essential utility for troubleshooting and monitoring. It doesn't display the log content directly but instead provides the exact file paths for all logs related to the Blocklet Server daemon and any installed blocklets. This allows you to easily locate and inspect logs using standard command-line tools like cat, tail, or less.
Usage#
To display the log file paths, simply run the command from within your Blocklet Server project directory:
blocklet server logs
blocklet server logsOutput Description#
The command's output is organized into two main sections: server-level logs and blocklet-specific logs.
Server Logs#
This section provides paths to the core Blocklet Server daemon logs. It will always show the main directory for daemon logs and point to the most recent business log file.
The server maintains several types of logs, which are rotated daily:
Filename Pattern | Description |
|---|---|
| Standard access logs, useful for tracking incoming HTTP requests. |
| The main business logs, containing operational information from the server. |
| Error logs, capturing any exceptions or critical errors thrown by the server. |
| Logs related to the underlying Blocklet Server service manager (abtnode). |
| Raw standard error output from the server process. |
| Raw standard output from the server process. |
Blocklet Logs#
If your Blocklet Server is running and you have blocklets installed, the command will also list the log files for each one. This is incredibly helpful for debugging individual blocklets in isolation.
For each installed blocklet, you will see two log file paths:
- Output: The path to
output.log, which contains the standard output (stdout) from the blocklet's process. - Error: The path to
error.log, which contains the standard error (stderr) from the blocklet's process.
Example Output#
Here is an example of what you might see when running the command on a server with two blocklets installed:
Example Output
$ blocklet server logs
Blocklet Server Logs
- Latest logs: /path/to/your/data/daemon/logs/daemon-2023-10-27.log
- Daemon Logs Directory: /path/to/your/data/daemon/logs
Daemon Logs
- access-<date>.log: access logs rotated by day
- daemon-<date>.log: business logs rotated by day
- daemon-error-<date>.log: error logs rotated by day
- service.log: abtnode service logs
- stderr.log: stderr logs
- stdout.log: stdout logs
my-first-blocklet@1.2.0
- Output: /path/to/your/data/logs/my-first-blocklet/output.log
- Error: /path/to/your/data/logs/my-first-blocklet/error.log
another-blocklet@2.0.1
- Output: /path/to/your/data/logs/another-blocklet/output.log
- Error: /path/to/your/data/logs/another-blocklet/error.logCommon Scenarios#
- Server Not Running: If the Blocklet Server is not running, the command cannot access blocklet-specific logs and will display a warning:
Unable to get blocklet logs because Blocklet Server is not running. - No Blocklets Installed: If the server is running but no blocklets have been installed yet, you will see the message:
No blocklets installed yet.