Skip to content

Logging

Ben Kroop edited this page Feb 26, 2019 · 2 revisions

Overview

  • Logs are created by the MessageLoggerBQ. The MessageLoggerBQ reads messages from a configurable set of channels and writes them to disk.
  • The MessageLoggerBQ starts a new log each time the binary is executed.
  • To start a new log, stop the MessageLoggerBQ and start it again. This can be done from the supervisor web interface or the supervisorctl commandline utility.

Configuring the Logger

The MessageLoggerBQ gets its configuration from two environment variables: LOGGED_CHANNELS: A comma separated list of the names of channels to be logged. LOG_BASE_PATH: An absolute path to where logs should be written. The MessageLoggerBQ will create a new directory at this path for each new log.

Running the Logger Manually

  • Start a new container with jet run
  • Export two environment variables:
    • export LOG_BASE_PATH=/jet/logs/
    • export LOGGED_CHANNELS=channel_name_0,channel_name_1,demo_channel,channel_etc
  • Run the MessageLoggerBQ inside the container
  • Run any other BQs you need in this or another container

Running the Logger Using Supervisor

The MessageLoggerBQ configuration in supervisor config looks something like this:

[program:logger]
environment=LOGGED_CHANNELS="force_sensor_output_channel,servo_command_channel,turbine_ignition,turbine_set_throttle,turbine_state,imu,timesync_master,timesync_client,GoNoGo,GoNoGo_output,joystick_yaw,joystick_pitch,joystick_roll,fiducial_detection_channel,pose",
LOG_BASE_PATH=/logs/
command=/jet/run/message_logger_bq_main
stderr_logfile = /var/log/supervisord/logger-stderr.log
stdout_logfile = /var/log/supervisord/logger-stdout.log
stopsignal=INT

Notes

  • Channel names must not contain slashes, spaces, or special characters. The MessageLoggerBQ creates a directory for each channel, using the name of the channel as the directory name. Slashes in channel names cause malformed logs. Planning to fix this in a future update to the logger.

Clone this wiki locally