E852 DAQ: The Logging subsystem

E852 DAQ: The Logging subsystem

Components:

Overview

The logging subsystem provides a way to monitor the activity of all the DAQ processes and keep log files. It does so by capturing the stdout and stderr output streams of the DAQ programs into a network socket and sending it to the daqlogd server. The daqlogd server keeps track of active processes, receives their output and writes it into log files.

One of the problems encountered when running the DAQ system was with programs going berserk: for example there exist hardware problems that cause the DAQio process to generate zillions of error messages. Some of those messages are important, some not, so piping all the DAQio output into /dev/null clearly is not a good solution. To cope with this problem the daqlogd server has a 'too slow' mode: when a program generates output faster than the server can write it into the log file, it goes into the 'too slow' mode by dropping parts of the data stream (similar to the UNIX syslogd daemon). In this mode, the system is no clogged down by error messages and the berserk program is not slowed down (In the DAQio case it means loosing beam spills).

Components

The daqlogd server

The daqlogd server is controlled by the LOGD_CONFIG_FILE environment variable. It points to the logd configuration database file. This file is in the Xrm database format and contains the following configuration options:


The log client

To send the output of a program to the logd server, use the following command:

> $E852DAQROOT/bin/log -nName -e command arguments

The log client program opens the TCP connection to the logd server, redirects stdout and stderr to it and exec's the command with it's arguments.

The log client program takes the logd server address from the E852_LOGD environment variable in the format 'hostname:port'.

Other uses of the log program are:


The Xlog program

The Xlog program is a user interface used to keep track of the lodg clients. A view of a typical Xlog window is given below:

The ListWidget area in the middle of the window contains the list of active logd clients. In this example, they are 'daqlogd' itself and the 'killer', 'messagesd', 'DAQio' and 'Event Builder' processes.

A logfile can be selected by clicking on it with the left mouse button.

The buttons in the bottom part of the window are:

A 'start.viewer' script starts /bin/tail -f in a xwsh window. See 'man tail' and 'man xwsh' for more details.

//end file// Const Olchanski