-
Notifications
You must be signed in to change notification settings - Fork 2
Logging
Both SLS and the Network Emulator provide logging functionality that can be configured to a certain level. MaxiNet's logging is partially available through the Network Emulator.
SLS uses the log4j logging framework. netSLS provides a default configuration that logs everything
on INFO-level to the console. To change the logging behavior modify the file
sls/hadoop/etc/hadoop/log4j.properties
.
Also refer to the official log4j documentation.
The Network Emulator uses the logging framework from the python standard library. To change its
behavior modify the file network_emulator/logging.cfg
. The default behavior logs everything on
INFO-level with exception to the following modules: ssh_tools, Testing, MaxiNet (they are set to
WARNING-level).
To change the global output level, set the logging output to a file etc., change the global stream handler:
[handler_stream_handler]
class=StreamHandler
level=DEBUG
formatter=formatter
args=(sys.stdout,)
For advanced tasks, as creating an individual logger for a certain module, refer to the official documentation.
As mentioned above, MaxiNet's logging is only partially available through the Network Emulator:
All logging of the core parts (FronendServer, WorkerClient) is done on the hosts running these
services and configured by the corresponding MaxiNet.cfg
files.
However, the logging of the MaxiNet experiment (application), which is started inside the Network
Emulator, is handled by the Network Emulator and can be configured in the
network_emulator/logging.cfg
file.
To change the desired log level or to assign its output to another handler, modify the corresponding
block:
[logger_MaxiNet]
qualname=MaxiNet
level=WARNING
handlers=stream_handler
The logging of the transport API is a rather special case as the scripts of the transport API are
executed as background processes on the MaxiNet workers. To be able to obtain output from these
scripts they are placed in background by the daemonize script
(network_emulator/transport_bin/daemonize
), which writes the processes' stdout and stderr to
files named by their PIDs (by default /tmp/netSLS/processes/$PID on the MaxiNet workers).
In case a process of the transport API fails, the Network Emulator fetches the corresponding output
file an prints is content using the logger.
These output files are not removed, until the simulation is restarted. So for debugging purposes the files can be examined manually on the respective workers.