NAME#

eldix.log - configuration file for logging of program \"eldix\" for the ELDICO electron diffration system

DESCRIPTION#

Program eldix drives the ELDICO electron diffraction system. The program can be configured with one or more configuration files that will be read at program startup. One particular configuration file controls the logging behaviour. The configuration file follows the convention of Windows \"ini\" files with section names given in [brackets] and keywords and their values separated by the \"equal\" sign (=). All lines starting with # are ignored.

The program reads configuration files from the following locations in the given order (in parenthesis: Windows)

  • current_working_directory/eldix.log (eldix.log.ini)

  • \$HOME/.eldix.log (%HOME%\eldix.log.ini)

  • \$HOME/.local/share/ELDICO/eldix.log (%APPDATA%\ELDICO\eldix.log.ini)

  • /usr/local/ELDICO/eldix.log (%PROGRAMDATA%\ELDICO\eldix.log.ini)

Entries given in the next available file will override all previous entries. This allows for mixing entries that can be changed by the user with entries set by a system administrator. The logging system is based on Python\'s logging module. More detailed information can be obtained from: https://docs.python.org/3/howto/logging.html.

EXAMPLE#

A typical configuration file eldix.log looks like:

[loggers]
keys=root,eldix

[handlers]
keys=consoleHandler,fileHandler

[formatters]
keys=consoleFormatter,fileFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler

[logger_eldix]
level=DEBUG
handlers=consoleHandler,fileHandler
qualname=eldix
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=consoleFormatter
args=(sys.stdout,)

[formatter_consoleFormatter]
format=%(name)s: %(message)s
datefmt=%Y/%m/%d %H:%M:%S

[handler_fileHandler]
class=logging.handlers.RotatingFileHandler
level=INFO
formatter=fileFormatter
# args: (filename, mode, maxBytes, backupCount)
args=("/home/eldico/.local/share/ELDICO/log/eldix.log",'m',1024*1024,99)

[formatter_fileFormatter]
format=%(asctime)s] [%(levelname)s] %(message)s
# format=[%(asctime)s] %(name)s::%(levelname)s: %(message)s
datefmt=%Y/%m/%d %H:%M:%S

CHANGEABLE PARAMETERS#

Most parameters should be left at their defaults. The only parameters that may be subject to changes are the location of the log files, the log file rotation and the criteria that apply to create a new version of the log file. Also the format of log strings and date strings may be changed.

In the example given above, the most likely line to be changed is:

args=("/home/eldico/.local/share/ELDICO/log/eldix.log",'m',1024*1024,99)

The first argument is the full path name of the log file. You can choose any other location provided that the directory exists and is writable by the program that wants to use it. The 3rd argument (1024*1024) is the maximum number of bytes to which the log file may grow before a new version is created. Here, 1 MB is chosen (1024*1024 bytes). The last argument (99) is the maximum amount of file versions which the programs is going to handle before starting over. The latest version always is called eldix.log, and all older files will be called eldix.log.N with increasing N with increased age. Here, 99 versions will be stored (i.e. the oldest file eldix.log.100 will be deleted).

SEE ALSO#

eldix, eldixusers, eldix.cfg

AUTHOR#

Claudio Klein, Marxperts GmbH, Norderstedt, Germany

COPYRIGHT#

© Copyright 2023 Marxperts GmbH, Norderstedt, Germany

ADDRESS#


_

MarXperts GmbH Phone: +49 - (40) - 529 884-0 Werkstr. 3 FAX: +49 - (40) - 529 884-20 D-22844 Norderstedt - GERMANY info\@marxperts.com www.marxperts.com _