Difference between revisions of "Mlogger"

From MidasWiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Pagelinks}}
 
==== Links ====
 
==== Links ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
+
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
 
* [[/Logger ODB tree| /Logger tree]]  
 
* [[/Logger ODB tree| /Logger tree]]  
 
* [[Keys in the ODB /Logger tree| /Logger keys]]  
 
* [[Keys in the ODB /Logger tree| /Logger keys]]  
Line 7: Line 8:
 
* [[Keys in the ODB /Logger/SQL subtree| /Logger/SQL keys]]  
 
* [[Keys in the ODB /Logger/SQL subtree| /Logger/SQL keys]]  
 
</div>
 
</div>
---------------
+
 
<br>
+
 
 +
== Purpose ==
 +
The purpose of <span style="color:darkcyan;">''mlogger''</span> is to save data from the experiment onto disk.  See [[#Logging in MIDAS|logging in MIDAS]] for
 +
a full list of what <span style="color:darkcyan;">''mlogger''</span> can do.
 +
 
 +
== Arguments ==
 +
 
 +
        [-e exptname ] :  experiment name (see [[Common Parameters to MIDAS Utilities]])
 +
        [-D ] : start program as a daemon (UNIX only).
 +
        [-s] : Save mode (debugging: protect ODB).
 +
        [-v] : Verbose (not to be used in conjunction with -D).
 +
        [-help ] : help
 +
 
 +
== Usage ==
 +
 
 +
    >mlogger -D
 +
 
 +
Notes
 +
 
 +
* The <span style="color:darkcyan;">''mlogger''</span> application requires an existing  [[/Equipment ODB tree]].
 +
* When <span style="color:darkcyan;">''mlogger''</span>  is started for the first time, it creates the [[/Logger ODB tree|/Logger]], the [[/History ODB tree|/History]] and the[[/Elog ODB tree| /Elog]] ODB trees with default values.
 +
* Once <span style="color:darkcyan;">''mlogger''</span> is running, you should be able to monitor its state with [[mstat]] or with [[mhttpd]].
 +
 
 +
=== Data storage location ===
 +
If mlogger is started interactively (i.e. without the argument [-D ]) The following information will be displayed :
 +
 
 +
$ mlogger
 +
Log    directory is  [[Keys in the ODB /Logger tree #/Logger/Data dir  |  <default directory>]]
 +
Data    directory is same as Log unless specified in channels/
 +
History directory is same as Log
 +
ELog    directory is same as Log
 +
MIDAS logger started. Stop with "!"
 +
 
 +
'''NOTE:'''
 +
* To specify a Data directory different from the Log directory, use the Channels subtree [[Keys in the ODB /Logger/Channels subtree #/Logger/Channels/0/Settings/Filename | Filename key]]
 +
* Different History and Elog directories may also be specified using the [[Keys in the ODB /Logger tree #/Logger/History dir | /Logger/History dir ]] and [[Keys in the ODB /Logger tree #/Logger/Elog dir | /Logger/Elog dir ]] keys respectively.
 +
 
 +
 
 
== Logging in MIDAS  ==
 
== Logging in MIDAS  ==
  
Line 18: Line 56:
 
* writing information to an electronic logbook
 
* writing information to an electronic logbook
 
* collecting and logging history events
 
* collecting and logging history events
* logging experimental data from one or more [[frontend]]s to storage device(s) such as disk or tape
+
* logging experimental data from one or more [[Frontend Operation#Frontend|Frontends]] to storage device(s) such as disk or tape
 
*  multiple Logging Channels can be defined
 
*  multiple Logging Channels can be defined
 
*    several different storage devices, formats and compression levels can be selected
 
*    several different storage devices, formats and compression levels can be selected
Line 33: Line 71:
  
 
*    Disk,
 
*    Disk,
*    Tape
 
 
*    FTP channel to a remote computer.
 
*    FTP channel to a remote computer.
 +
*    Tape (no longer maintained)
  
 
Data can currently be written in five different formats :
 
Data can currently be written in five different formats :
Line 45: Line 83:
 
The user may of course write their own custom data logger to save the data in any format they choose.  
 
The user may of course write their own custom data logger to save the data in any format they choose.  
  
=== mlogger creates the <span style="color:purple;">''/Logger''</span> ODB tree ===
+
=== mlogger creates ODB trees ===
 
When <span style="color:darkcyan;">''mlogger''</span> is started for the first time, it creates the [[/Logger ODB tree]] (including a single logger channel - channel 0), and fills it with default settings. The <span style="color:purple;">''/Logger''</span> tree contains all the relevant information for <span style="color:darkcyan;">''mlogger''</span> to run properly. The user has no code to write in order for the system to operate correctly. However, the user will want to customize the logger for his/her own experiment, by setting the keys in the <span style="color:purple;">''/Logger''</span>  tree to suitable values.
 
When <span style="color:darkcyan;">''mlogger''</span> is started for the first time, it creates the [[/Logger ODB tree]] (including a single logger channel - channel 0), and fills it with default settings. The <span style="color:purple;">''/Logger''</span> tree contains all the relevant information for <span style="color:darkcyan;">''mlogger''</span> to run properly. The user has no code to write in order for the system to operate correctly. However, the user will want to customize the logger for his/her own experiment, by setting the keys in the <span style="color:purple;">''/Logger''</span>  tree to suitable values.
  
Line 51: Line 89:
 
In addition to the <span style="color:purple;">''/Logger''</span>  tree, mlogger also creates the [[/History ODB tree]], used in the optional [[History System]] features. If MIDAS is compiled with mySQL support, a [[Keys in the ODB /Logger/SQL subtree |/Logger/SQL subtree]] will also be created in the <span style="color:purple;">''/Logger''</span> tree (see [[logging to a mySQL database]]).
 
In addition to the <span style="color:purple;">''/Logger''</span>  tree, mlogger also creates the [[/History ODB tree]], used in the optional [[History System]] features. If MIDAS is compiled with mySQL support, a [[Keys in the ODB /Logger/SQL subtree |/Logger/SQL subtree]] will also be created in the <span style="color:purple;">''/Logger''</span> tree (see [[logging to a mySQL database]]).
  
The data channels as well as the history logging are rescanned automatically at each [[start transition]]. In other words, additional logging channels can be defined while running, but the effect will take place only at the following start transition.
+
[[Category:Utilities]] [[Category:Data Logging]]
 
 
 
 
 
 
 
 
=== Starting mlogger utility ===
 
 
 
    Arguments
 
        [-h ] : help
 
        [-e exptname ] : experiment name (see [[odbedit]] - ODB Editor and run control utility)
 
        [-D ] : start program as a daemon (UNIX only).
 
        [-s] : Save mode (debugging: protect ODB).
 
        [-v] : Verbose (not to be used in conjunction with -D).
 
    Usage
 
    >mlogger -D
 
 
 
Notes
 
 
 
* The <span style="color:darkcyan;">''mlogger''</span> application requires an existing  [[/Equipment ODB tree]].
 
* When <span style="color:darkcyan;">''mlogger''</span>  is started for the first time, it creates the [[/Logger ODB tree|/Logger]], the [[/History ODB tree|/History]] and the[[/Elog ODB tree| /Elog]] ODB trees with default values.
 
* Once <span style="color:darkcyan;">''mlogger''</span> is running, you should be able to monitor its state with [[mstat]] or with [[mhttpd]].
 
 
 
=== Data storage location ===
 
If mlogger is started interactively (i.e. without the argument [-D ]) The following information will be displayed :
 
 
 
$ mlogger
 
Log    directory is  [[Keys in the ODB /Logger tree #/Logger/Data dir  |  <default directory>]]
 
Data    directory is same as Log unless specified in channels/
 
History directory is same as Log
 
ELog    directory is same as Log
 
MIDAS logger started. Stop with "!"
 
 
 
'''NOTE:'''
 
* To specify a Data directory different from the Log directory, use the Channels subtree [[Keys in the ODB /Logger/Channels subtree #/Logger/Channels/0/Settings/Filename | Filename key]]
 
* Different History and Elog directories may also be specified using the [[Keys in the ODB /Logger tree #/Logger/History dir | /Logger/History dir ]] and [[Keys in the ODB /Logger tree #/Logger/Elog dir | /Logger/Elog dir ]] keys respectively.
 

Latest revision as of 17:47, 14 July 2015


Links


Purpose

The purpose of mlogger is to save data from the experiment onto disk. See logging in MIDAS for a full list of what mlogger can do.

Arguments

       [-e exptname ] :  experiment name (see Common Parameters to MIDAS Utilities)
       [-D ] : start program as a daemon (UNIX only).
       [-s] : Save mode (debugging: protect ODB).
       [-v] : Verbose (not to be used in conjunction with -D).
       [-help ] : help

Usage

    >mlogger -D 

Notes

  • The mlogger application requires an existing /Equipment ODB tree.
  • When mlogger is started for the first time, it creates the /Logger, the /History and the /Elog ODB trees with default values.
  • Once mlogger is running, you should be able to monitor its state with mstat or with mhttpd.

Data storage location

If mlogger is started interactively (i.e. without the argument [-D ]) The following information will be displayed :

$ mlogger
Log     directory is    <default directory>
Data    directory is same as Log unless specified in channels/
History directory is same as Log 
ELog    directory is same as Log 
MIDAS logger started. Stop with "!"

NOTE:


Logging in MIDAS

The MIDAS Logger, mlogger is supplied in the MIDAS package. This utility can perform several functions (selected by the user via the /Logger ODB tree ) including:

  • logging System messages to a Message file or as message events
  • logging information to a mySQL database
  • writing information to an electronic logbook
  • collecting and logging history events
  • logging experimental data from one or more Frontends to storage device(s) such as disk or tape
  • multiple Logging Channels can be defined
  • several different storage devices, formats and compression levels can be selected
  • data can be logged to different subdirectories on disk
  • data can be logged to a remote computer, using the FTP mode
  • events can be selected for logging by Event ID or Trigger mask
  • Event Filtering can be implemented
  • runs can be automatically stopped and restarted after a certain number of events, or a certain time
  • the complete ODB contents can be saved
    • into a file at the beginning and/or end of run
    • and/or into the data stream

The mlogger utility runs on the backend computer, receiving events from the buffer manager. It supports three type of storage devices so far, i.e.

  • Disk,
  • FTP channel to a remote computer.
  • Tape (no longer maintained)

Data can currently be written in five different formats :

  • MIDAS binary,
  • ASCII,
  • ROOT
  • DUMP

The user may of course write their own custom data logger to save the data in any format they choose.

mlogger creates ODB trees

When mlogger is started for the first time, it creates the /Logger ODB tree (including a single logger channel - channel 0), and fills it with default settings. The /Logger tree contains all the relevant information for mlogger to run properly. The user has no code to write in order for the system to operate correctly. However, the user will want to customize the logger for his/her own experiment, by setting the keys in the /Logger tree to suitable values.


In addition to the /Logger tree, mlogger also creates the /History ODB tree, used in the optional History System features. If MIDAS is compiled with mySQL support, a /Logger/SQL subtree will also be created in the /Logger tree (see logging to a mySQL database).