-
Notifications
You must be signed in to change notification settings - Fork 7
Logging
Ben Kroop edited this page Feb 26, 2019
·
2 revisions
- Logs are created by the
MessageLoggerBQ. TheMessageLoggerBQreads messages from a configurable set of channels and writes them to disk. - The
MessageLoggerBQstarts a new log each time the binary is executed. - To start a new log, stop the
MessageLoggerBQand start it again. This can be done from the supervisor web interface or thesupervisorctlcommandline utility.
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.
- 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
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- Channel names must not contain slashes, spaces, or special characters. The
MessageLoggerBQcreates 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.