Log Access

Overview

Simulate 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 remote actively running simulation the logs can be streamed as they happen. To see logs from a local simulation check the section Local Logging.
In addition to log lines that you have added to your simulation, Simulate will also include logging from internal components in the same log files allowing you to see a consolidated view.

Accessing Logs

To access log files use the aether log CLI command
aether log [options]
The following optional flags that can be passed to the log command to control how log data is accessed
Option
Text
--follow
Connects to the latest position in the logs streaming new content. If no simulation is running the last few lines of the previous simulations logs will be returned
--from-start
Begins streaming logs from the beginning and continues to stream newly created log lines
--filename <filename>
Downloads logs to a specified file. If no filename is passed the default of ./aether.log is used

Structure of logs

Simulate logs are retuned in JSON format with the following fields.
{
"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

Field
Description
timestamp
UTC time of when the log was written
message
Log messages as defined by Simulate, including user defined logs
module_path
Module or method where the log line came from
file
File where the log line came from
line
Line number where the log line came from within the file provided
level
Logging level affecting the log line.
Log level options:
  • DEBUG
  • INFO
  • WARN
  • ERROR
target
Logger in which the log line is written to
thread
Name of the thread the message was logged from
thread_id
ID of the thread the message was logged from
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 nonce
mdc.process_name
Name of the process that logged the message
mdc.process_id
ID of the process that logged the message

Limiting Disk Space Available

For long simulation runs log file space can become a restriction depending on the profile of the machines you have specified for your cluster. In order to ensure that space is not exceeded it is possible to pass in a per machine disk space limit when starting a simulation.
aether run --log-size-limit <size value><size units>
Where the <size value> is the value of space to use and <size units> specifies the units, a space can be used between value and units for clarity so 1GiB is the same as 1 GiB
  • Decimal: KB, MB, GB, TB
  • Binary: KiB, MiB, GiB, TiB
This adheres to the IEC standard as follows:
  • 1 kilobyte = 1000 bytes with 2 letter abbreviations B, KB, MB, GB and TB.
  • 1 kibibyte = 1024 bytes with 3 letter abbreviations B, KiB, MiB, GiB and TiB.
Log data will be removed in increments of 100MiB. This means that should you have a limit of 1GiB set and exceed this limit the oldest log data will be deleted in a chunk of 100MiB leaving you with 900MiB total remaining.
The minimum disk space allowance you should use is 100 MiB. If you set to a value lower than this the default of 100MiB will be used. Be aware that setting a value this low would mean that when the limit was breached, all of your historical log data would be deleted in order to free up a 100MiB chunk.
If the limit size specified is larger than the disk space available the system will refuse to start, returning an error at the command line
## Local Logging
Local logs are stored (by default) in a logs/ folder in the simulation directory and can be easily opened from any text editor. For each run of the simulation a new folder is created with the relevant logs.
If a different location is desired then these logs can be stored in any location by starting the simulation with
aether run --log-path="C:\path\to\store\logs"