marXperts X-ray diffration systems
The program reads configuration files from the following locations in the given order (in parenthesis: Windows)
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.
A typical configuration file marX.log looks like:
[loggers] keys=root,marX [handlers] keys=consoleHandler,fileHandler [formatters] keys=consoleFormatter,fileFormatter [logger_root] level=DEBUG handlers=consoleHandler [logger_marX] level=DEBUG handlers=consoleHandler,fileHandler qualname=marX 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=DEBUG formatter=fileFormatter # args: (filename, mode, maxBytes, backupCount) args=("/home/mar/.local/share/MAR/log/marX.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
In the example given above, the most likely line to be changed is:
args=("/home/mar/.local/share/MAR/log/marX.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 marX.log, and all older files will be called marX.log.N with increasing N with increased age. Here, 99 versions will be stored (i.e. the oldest file marX.log.100 will be deleted).
Germany
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 | |