From MidasWiki
Jump to: navigation, search

July 2017 Stefan Visit

Creation of run log file

A run log contains information about individual runs, such as start/stop time, number of events, hardware settings etc. One possibility is to write the run log to a MySQL database through the ODB settings as described under Logging to a mySQL database. A new feature has been added to write directly to an ASCII file, which can be viewed in the message web page. The ODB structure has been changed in the following way:

  • /Logger/SQL has been move to /Logger/Runlog/SQL for writing to the SQL database
  • A new /Logger/Runlog/ASCII directory is there to write directly to an ASCII file

The ODB variables for the ASCII runlog directory are:

  • Write data - flag to enable/disable writing
  • Filename - file name to write to. If the file name does not contain an explicit path, the default log directory from the odb (/Logger/Data dir) is used.
  • Links BOR - collection of links to ODB values to be written at the begin-of-run
  • Links EOR - collection of links to ODB values to be written at the end-of-run

If no "Runlog" subdirectory exists, the logger creates a default one which contains the run number, start time, stop time and number of events in the run.

Base URL

Various links in the mhttpd web pages need to link back to the status page. This is problematic since for example the ODB page can have a url in the form


A link in this page pointing back to the status page has to use a relative URL in the form

<a href="../../">

or an absolute link of the form


While this is simple for the normal case, it becomes more complicated if mhttpd is run under an Apache proxy. The URL might have a leading part like

https://<host>/<subdir>/<mhttpd URL>

Since the <subdir> is stripped by the proxy server, mhttpd does not know how to generate a link pointing back to its root. Therefore a new ODB entry has been created under

/Experiment/Base URL

which is set by default to "/" which is fine for non-proxy applications. If one wants to use a proxy, this parameter has to be set to the URL under which your can reach mhttpd, such as

/Experiment/Base URL = https://yourhost/somedir/