Logging
Overview
Aether Engine provides means to view logs of your local or remote active or previously run simulations. By connecting to a remote or local instance, you can download or stream the logs of the last run simulation. Alternatively, by connecting to a local or remote actively running simulation the logs can be streamed as they happen.
Purpose of logs
The purpose of the Aether Engine logging framework is to provide clear and concise information about what is happening in your local or remote running simulations.
The logs identify which areas of the simulation have crashed and mark them accordingly. The logs are completely visible locally, and can be downloaded or streamed. By default we will show you the logs of your most recently run simulation. Aether Engine is compatible with printf
function and other existing log libraries.
Quick start
Open a terminal or console and run the following:
aether log
That is all you need to stream logs from your local current simulation (or most recent if none are running)
Optional flags
Aether Engine provides additional flags that can be passed along with the log command.
- --debug
- --follow
- --from-start
- --filename
These flags provide additional functionality and can be used in conjunction. Listed below explains the functionality of each flag independently.
Flag functionality
The default functionality is to stream logs from the the current (or most recent if none are running) simulation to the console.
To enable debug logging for the CLI. Default set to false
aether log --debug
If you just want to stream the logs from the current position rather than the beginning. If the simulation is no longer running this will return the last few lines
aether log --follow
If you want to stream or download the logs from the first logs generated by the simulation.
aether log --from-start
To download the stdout
logs to a file for your recently run simulation. Default filename set to aether.log
aether log --filename <filename>
Structure of logs
A reference section for key values can be found below the following example.
{"timestamp":"2020-02-25T13:22:21.261381+00:00","message":"Spawn(47) with pid 127.0.0.1.9191.0","module_path":"manager_server","file":"manager/server/src/lib.rs","line":365,"level":"INFO","target":"manager_server","thread":"main","pid":"127.0.0.1.9000.0","thread_id":140554351096928,"mdc": {"process_name":"manager","process_id":"140554351096928"}}
Reference
timestamp
UTC time of when the log was written
"timestamp":"2020-02-25T13:22:21.261381+00:00"
message
Log messages as defined by the Aether Engine, including user defined logs
"message":"Spawn(47) with pid 127.0.0.1.9191.0"
module_path
Module or method where the log line came from
"module_path":"manager_server",
file
File where the log line came from
"file":"manager/server/src/lib.rs"
line
Line number where the log line came from within the file provided
"line":365
level
Logging level affecting the log line.
Log level options:
DEBUG
INFO
WARN
ERROR
"level":"INFO"
target
Logger in which the log line is written to
"target":"manager_server"
thread
Thread name of the thread handling the log line
"thread":"main"
pid
The process id at the OS level
We format the pid as follows X.Y.Z
. Where X
is the is an IP address, Y
is a port and Z
is a nounce
"pid":"127.0.0.1.9000.0"
thread_id
Thread id of the thread handling the log line
"thread_id":140554351096928
process_name
Process name of the process handling the log line
"process_name":"manager"
process_id
Process id of the process handling the log line
"process_id":"140554351096928"
Which logs are collected
Aether Engine is composed of many parts and each part holds important information. Therefore the Aether Engine logs-out all necessary information depending on the log level you have defined.
Aether Engine logs actions produced by the following parts:
- HadeanOS
- Aether Engine
- Muxer
- User defined netcode
- User simulation code