Electronic Logbook (ELOG): Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Pagelinks}}
= Links =
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
* [[/Elog ODB tree]]
* [[mhttpd]]
* mhttpd [[Elog Page]]
* [https://midas.psi.ch/elog/ '''Elog''' ]
* [[Melog]] Utility
* [[Elog|Elog Utility]]
</div>
= Introduction =
The '''Electronic LogBook''' (ELOG) is a utility built-in the [[mhttpd|web server]]. It is available and operational once the web-server is running. A dedicated button "ELOG" will be present on the main  
The '''Electronic LogBook''' (ELOG) is a utility built-in the [[mhttpd|web server]]. It is available and operational once the web-server is running. A dedicated button "ELOG" will be present on the main  
Midas status page for creating new entries. This mode is referred as the [[Build-in Elog]].
Midas status page for creating new entries. This mode is referred as the [[#Built-in Elog|Built-in Elog]].


This tool can replace the experimental logbook for daily entries. The main advantage of the Elog over a paper logbook is the possiblity to access it remotely, and provide a general knowledge of the experiment.
This tool can replace the experimental logbook for daily entries. The main advantage of the Elog over a paper logbook is the possiblity to access it remotely, and provide a general knowledge of the experiment.


More recently, the independent [https://midas.psi.ch/elog/ '''Elog''' ] package can be linked to a Midas experiment. Its advantage over the built-in version is its flexibility. This package is used worldwide and improvements are constantly being made. A full-features documentation and standalone installation can be found at the Elog web site.
More recently, the independent [https://elog.psi.ch/elog/ '''Elog''' ] package can be linked to a Midas experiment. Its advantage over the built-in version is its flexibility. This package is used worldwide and improvements are constantly being made. A full-features documentation and standalone installation can be found at the Elog web site.
 
== Built-in Elog ==
The ELOG page (accessed by clicking the Elog button if present on the main status page ) provides access to an electronic logbook.  the Elog is not limited strictly to experiments. Worldwide Elog implementations can be found on the internet. This internal implementation doesn't requires any setup to be operational. The Elog is customized through the ODB [[/Elog_ODB_tree|/Elog]] tree.


===Built-in Elog===
Data files for the built-in elog are stored in the directory defined by the <code>/Logger/Elog dir</code> ODB key. If that ODB key is empty, then the directory specified in <code>/Logger/Data dir</code> is used instead.
The ELOG page (accessed by clicking the Elog button if present on the main status page ) provides access to an electronic logbook.  the Elog is not limited strictly to experiments. Worldwide Elog implementations can be found on the internet. This internal implementation doesn't requires any setup to be operational.
===External Elog===
The external implementation requires a proper Elog installation which is fully described on the Elog web site. The External Elog implementation also requires a dedicated entry in the ODB as shown in the code below. It also requires the package Elog to be already installed, and properly configured. Once the ODB entry is present, the internal ELOG is disabled.  


The Elog is customized through the ODB /Elog tree.
== External Elog ==
The external implementation requires a proper Elog installation which is fully described on the Elog web site. The External Elog implementation also requires a dedicated entry in the [[/Elog ODB tree]] as shown in the code below. It also requires the package Elog to be already installed, and properly configured. Once the ODB entry is present, the internal ELOG is disabled.  


The External Elog is customized through the configuration file elogd.cfg (see [[#Installation|Installation]] below).


====Installation====
= Installation of External Elog =
Installation requires requires several steps described below.
Installation requires requires several steps described below.


* Download the Elog package from the web site mentioned above.
== Build Elog package ==
** Windows, Linux, Mac version can be found there. Simple installation procedures are also described. Its installation can be done at the system level or at the user level. The Elog can service multiple Electronic logbooks in parallel and therefore an extra entry in its configuration file can provide specific experimental elog in a similar fashion as the internal one.


You need to take note of several consideration for its installation. Several locations are required for the different files that elog deals with.
On Linux and Mac, we recommend building elog from git sources:
** elog resource directory ( e.g. /elog_installation_dir where elog is installed)
<pre>
** logbook directory (ex: /myexpt/logbook where the pwd and elog entries are stored).
mkdir -p $HOME/packages
** The pwd file uses encryption for the user password.
cd $HOME/packages
git clone https://bitbucket.org/ritt/elog --recursive
cd elog
git pull ### update to latest version
make -j
ls -l elogd
</pre>


* As this Elog installation is tailored towards an experiment, a restriction applies i.e. ensure that the mhttpd and elog applications shares at least the same file system.
== Installation ==
** This means that either both applications runs on the same machine or a nsf mount provides file sharing.
** You need to know the node and ports for both applications. Like mhttpd, elogd also requires a port number for communication through the web (e.g. NodeA:mhttpd -p 8080, NodeB:elogd -p 8081).


Elog will run from it's build directory, an "install" step is not needed.
We will use Elog in conjunction with MIDAS mhttpd and Apache httpd. mhttpd will run on TCP port 8080, elogd on port 8082, apache httpd will provide HTTPS encryption and password protection, see https://daq00.triumf.ca/DaqWiki/index.php/Ubuntu#Install_apache_httpd_proxy_for_midas_and_elog
Make sure "ProxyPass /elog/" is uncommented in apache config file, restart apache after making this change.
Try https://yourhostname/elog/, after entering correct password, error should be: "Service Unavailable"
== Configuration file elogd.cfg ==
* copy the default midas/src/elogd.cfg from the MIDAS distrbution to your operating directory.
* copy the default midas/src/elogd.cfg from the MIDAS distrbution to your operating directory.
* modify the elogd.cfg to reflect your configuration
* modify the elogd.cfg to reflect your configuration
    
    
<pre>
   # This is a simple elogd configuration file to work with MIDAS
   # This is a simple elogd configuration file to work with MIDAS
   # $Id: mhttpd.dox 4032 2007-11-02 17:13:52Z amaudruz $
   #  
 
   [global]
   [global]
   ; port under which elogd should run
   ; port under which elogd should run
   port = 8081                           
   port = 8082                         
   ; password file, created under 'logbook dir'
   ; password file, created under 'logbook dir'
   password file = elog.pwd                 
   password file = elog.pwd                 
   ; directory under which elog was installed (themes etc.)
   ; directory under which elog was installed (themes etc.)
   resource dir = /elog_installation_dir   
   resource dir = /home/exptuser/packages/elog
   ; directory where the password file will end up
   ; directory where the password file will end up
   logbook dir = /myexpt/logbook     
   logbook dir = /myexpt/logbook     
   ; anyone can create it's own account
   ; anyone can create it's own account
   self register = 1                       
   self register = 1                       
   ; URL under which elogd is accessible
   ; this is the URL of the elogd https proxy
   url = http://ladd00.triumf.ca:8081     
   url = https://myexpt.triumf.ca/elog/
   ; the "main" tab will bring you back to mhttpd
   ; the "main" tab will bring you back to mhttpd
   main tab = Xenon                         
   main tab = Xenon                         
   ; this is the URL of mhttpd which must run on a different port
   ; this is the URL of mhttpd https proxy
   main tab url = http://NodeA:8080
   main tab url = https://myexpt.triumf.ca
   ; only needed for email notifications
   ; email server for sending email notifications, contact your campus network administrator for correct hostname
   smtp host = your.smtp.host             
   smtp host = smtp.triumf.ca           
   ; Define one logbook for online use. Severl logbooks can be defined here
   ; Define one logbook for online use. Severl logbooks can be defined here
   [MyOnline]
   [MyOnline]
Line 75: Line 100:
   Quick filter = Date, Type, Author
   Quick filter = Date, Type, Author
   ; Don't send any emails
   ; Don't send any emails
   Suppress email to users = 1            
   Suppress email to users = 1
</pre>
 
Konstantin's most recently used config file:
 
<pre>
[global]
port = 9085
URL = https://daq00.triumf.ca/elog-dl
SMTP host = smtp.triumf.ca
Logfile = elogd.log
Time format = %d %b %Y %H:%M
Default encoding = 1
Allowed encoding = 1
Password file = elogd-dl.passwd
Admin User = Olchansk
Menu commands = List, New, Edit, Delete, Reply, Duplicate, Find, Config, Help
Self register = 3
Message Width = 80
Preset Author = $long_name
Preset on reply Author = $long_name
Locked Attributes = Author
Max content length = 100000000


* start the elog daemon. -x is for the shell substitution of the command Preset Run number = $shell(...)
[DarkLight]
* The argument invokes the odbedit remotely if needed to retrieve the current run number. You will have to ensure the proper path to the odbedit and the proper -e, -h arguments for the experiment and host.
Theme = default
Comment = DarkLight elog
Attributes = Author, Type, Category, Subject
Options Type = Routine, Problem Report, Problem Fixed
Options Category = General, Software, Hardware
Extendable Options = Category, Type
Required Attributes = Author, Type
Page Title = DL - $subject
Reverse sort = 1
Quick filter = Date, Type
Use Email Subject = [DL] $subject
Use email from = noreply@daq00.triumf.ca
</pre>


You may want to verify this command from the console.
== Start the Elog daemon ==
* start the elog daemon
* -x is for the shell substitution of the command Preset Run number = $shell(...)
* if elog is not running on same machine as midas (mhttpd, mlogger), change the odbedit command in the config file to have correct -e and -h arguments.
<pre>
$HOME/packages/elog/elogd -c dldaq.cfg -x
</pre>


  NodeB:~>/installation_elog_dir/elogd -c elogd.cfg -x<cr> starts the mhttpd at its correct port and possibly in the daemon form.
== Activate External Elog ==
  NodeA:~>mhttpd -p 8080 -D


At this point the Elog from the MIDAS web page is accessing the internal Elog. To activate the external Elog, include in the ODB two entries such as:
At this point the Elog from the MIDAS web page is accessing the [[[#Built-in Elog|Built-in]]] (internal) Elog. To activate the external Elog you need to edit two ODB variables (which mhttpd automatically created):


  NodeX:> odbedit -e myexpt -h NodeA
* the ODB string "/Elog/URL" needs to be set to the URL of the external ELOG.
  [NodeX:myexpt:Running]/>cd elog
* the ODB bool "/Elog/External Elog" needs to be set to 'y'
  [NodeX:myexpt:Running]/Elog>create string Url
  String length [32]: 64
  [NodeX:myexpt:Running]/Elog>set Url http://NodeB:8081/MyOnline
  [NodeX:myexpt:Running]
  [NodeX:myexpt:Running]/Elog>create string "Logbook Dir"
  String length [32]: 64
  [NodeX:myexpt:Running]/Elog>set "Logbook Dir" /myexpt/logbook


  [NodeX:myexpt:Running]/Elog>ls
Note that after changing the ODB variable 'External Elog' from 'n' to 'y' you will need to reload the elog page in order to get the external elog.
Logbook Dir                    /home/myexpt/ElogBook
Url                            http://NodeB:8081/MyOnline


Confirm proper operation of the external Elog by creating an entry. You will be prompted for a username and password. Click on New registration. Full control of these features are described in the Elog documentation.
Confirm proper operation of the external Elog by creating an entry. You will be prompted for a username and password. Click on New registration. Full control of these features are described in the Elog documentation.
Line 106: Line 161:
   NodeB:~>/installation_elog_dir/elogd -c elogd.cfg -x -D
   NodeB:~>/installation_elog_dir/elogd -c elogd.cfg -x -D


= How to convert Built-in Elog files to External files =
In the event you had a previous entry under the internal elog, you can convert the internal to external using the elconv tool.
In the event you had a previous entry under the internal elog, you can convert the internal to external using the elconv tool.


Line 111: Line 167:
   NodeB:~> cd /myexpt/logbook
   NodeB:~> cd /myexpt/logbook
   NodeB:~> /installation_elog_dir/elconv
   NodeB:~> /installation_elog_dir/elconv
= How to send entries to the Elog from a script =
Utilities exist to send elog entries automatically (e.g. from a script run at begin-of-run). Use [[Melog|melog]] to send an
entry to a Built-in elog, or [[Elog|elog]] to send an entry to an '''external''' elog.
[[Category:ELOG]]

Latest revision as of 18:24, 12 January 2024


Links

Introduction

The Electronic LogBook (ELOG) is a utility built-in the web server. It is available and operational once the web-server is running. A dedicated button "ELOG" will be present on the main Midas status page for creating new entries. This mode is referred as the Built-in Elog.

This tool can replace the experimental logbook for daily entries. The main advantage of the Elog over a paper logbook is the possiblity to access it remotely, and provide a general knowledge of the experiment.

More recently, the independent Elog package can be linked to a Midas experiment. Its advantage over the built-in version is its flexibility. This package is used worldwide and improvements are constantly being made. A full-features documentation and standalone installation can be found at the Elog web site.

Built-in Elog

The ELOG page (accessed by clicking the Elog button if present on the main status page ) provides access to an electronic logbook. the Elog is not limited strictly to experiments. Worldwide Elog implementations can be found on the internet. This internal implementation doesn't requires any setup to be operational. The Elog is customized through the ODB /Elog tree.

Data files for the built-in elog are stored in the directory defined by the /Logger/Elog dir ODB key. If that ODB key is empty, then the directory specified in /Logger/Data dir is used instead.

External Elog

The external implementation requires a proper Elog installation which is fully described on the Elog web site. The External Elog implementation also requires a dedicated entry in the /Elog ODB tree as shown in the code below. It also requires the package Elog to be already installed, and properly configured. Once the ODB entry is present, the internal ELOG is disabled.

The External Elog is customized through the configuration file elogd.cfg (see Installation below).

Installation of External Elog

Installation requires requires several steps described below.

Build Elog package

On Linux and Mac, we recommend building elog from git sources:

mkdir -p $HOME/packages
cd $HOME/packages
git clone https://bitbucket.org/ritt/elog --recursive
cd elog
git pull ### update to latest version
make -j
ls -l elogd

Installation

Elog will run from it's build directory, an "install" step is not needed.

We will use Elog in conjunction with MIDAS mhttpd and Apache httpd. mhttpd will run on TCP port 8080, elogd on port 8082, apache httpd will provide HTTPS encryption and password protection, see https://daq00.triumf.ca/DaqWiki/index.php/Ubuntu#Install_apache_httpd_proxy_for_midas_and_elog

Make sure "ProxyPass /elog/" is uncommented in apache config file, restart apache after making this change.

Try https://yourhostname/elog/, after entering correct password, error should be: "Service Unavailable"

Configuration file elogd.cfg

  • copy the default midas/src/elogd.cfg from the MIDAS distrbution to your operating directory.
  • modify the elogd.cfg to reflect your configuration
  # This is a simple elogd configuration file to work with MIDAS
  # 
  [global]
  ; port under which elogd should run
  port = 8082                           
  ; password file, created under 'logbook dir'
  password file = elog.pwd                
  ; directory under which elog was installed (themes etc.)
  resource dir = /home/exptuser/packages/elog
  ; directory where the password file will end up
  logbook dir = /myexpt/logbook     
  ; anyone can create it's own account
  self register = 1                       
  ; this is the URL of the elogd https proxy
  url = https://myexpt.triumf.ca/elog/
  ; the "main" tab will bring you back to mhttpd
  main tab = Xenon                        
  ; this is the URL of mhttpd https proxy
  main tab url = https://myexpt.triumf.ca
  ; email server for sending email notifications, contact your campus network administrator for correct hostname
  smtp host = smtp.triumf.ca             
  ; Define one logbook for online use. Severl logbooks can be defined here
  [MyOnline]
  ; directory where the logfiles will be written to
  Data dir = /myexpt/logbook            
  Comment = My MIDAS Experiment Electronic Logbook
  ; mimic old mhttpd behaviour
  Attributes = Run number, Author, Type, System, Subject     
  Options Type = Routine, Shift Summary, Minor Error, Severe Error, Fix, Question, Info, Modification, Alarm, Test, Other, 
  Options System = General, DAQ, Detector, Electronics, Target, Beamline
  Extendable Options = Type, System
  ; This substitution will enter the current run number
  Preset Run number = $shell(odbedit -e myexpt -h NodeA -d Runinfo -c 'ls -v \"run number\"')    
  Preset Author = $long_name
  Required Attributes = Type, Subject
  ; Run number and Author cannot be changed
  Locked Attributes = Run number, Author  
  Page Title = ELOG - $subject
  Reverse sort = 1
  Quick filter = Date, Type, Author
  ; Don't send any emails
  Suppress email to users = 1

Konstantin's most recently used config file:

[global]
port = 9085
URL = https://daq00.triumf.ca/elog-dl
SMTP host = smtp.triumf.ca
Logfile = elogd.log
Time format = %d %b %Y %H:%M
Default encoding = 1
Allowed encoding = 1
Password file = elogd-dl.passwd
Admin User = Olchansk
Menu commands = List, New, Edit, Delete, Reply, Duplicate, Find, Config, Help
Self register = 3
Message Width = 80
Preset Author = $long_name
Preset on reply Author = $long_name
Locked Attributes = Author
Max content length = 100000000

[DarkLight]
Theme = default
Comment = DarkLight elog
Attributes = Author, Type, Category, Subject
Options Type = Routine, Problem Report, Problem Fixed
Options Category = General, Software, Hardware
Extendable Options = Category, Type
Required Attributes = Author, Type
Page Title = DL - $subject
Reverse sort = 1
Quick filter = Date, Type
Use Email Subject = [DL] $subject
Use email from = noreply@daq00.triumf.ca

Start the Elog daemon

  • start the elog daemon
  • -x is for the shell substitution of the command Preset Run number = $shell(...)
  • if elog is not running on same machine as midas (mhttpd, mlogger), change the odbedit command in the config file to have correct -e and -h arguments.
$HOME/packages/elog/elogd -c dldaq.cfg -x

Activate External Elog

At this point the Elog from the MIDAS web page is accessing the [[[#Built-in Elog|Built-in]]] (internal) Elog. To activate the external Elog you need to edit two ODB variables (which mhttpd automatically created):

  • the ODB string "/Elog/URL" needs to be set to the URL of the external ELOG.
  • the ODB bool "/Elog/External Elog" needs to be set to 'y'

Note that after changing the ODB variable 'External Elog' from 'n' to 'y' you will need to reload the elog page in order to get the external elog.

Confirm proper operation of the external Elog by creating an entry. You will be prompted for a username and password. Click on New registration. Full control of these features are described in the Elog documentation. Stop and restart the Elogd in the background.

  NodeB:~>/installation_elog_dir/elogd -c elogd.cfg -x -D

How to convert Built-in Elog files to External files

In the event you had a previous entry under the internal elog, you can convert the internal to external using the elconv tool.

  NodeB:~> cp internal/elog_logbook/*.log /myexpt/logbook/.
  NodeB:~> cd /myexpt/logbook
  NodeB:~> /installation_elog_dir/elconv

How to send entries to the Elog from a script

Utilities exist to send elog entries automatically (e.g. from a script run at begin-of-run). Use melog to send an entry to a Built-in elog, or elog to send an entry to an external elog.