Logging Support

From version 1.1.0, it is possible to configure Damaris to write internal events to log files. Enabling the logging capability feature is easy. To enable logging, just add the following line of code at the root of your XML file. It should be noted that logging feature in Damaris is based on the Boost Logging Library.

<log FileName="log/2dmesh" RotationSize="5" 
    LogFormat="[%TimeStamp%]: %Message%" 

The above <Log> tag contains some attributes that are described below:

  • FileName: contains the path and the initial part of the log file name. To this string, the process number that produced the log and the file number are added.
  • RotationSize (in MegaBytes):  Shows how large the log files should be. If the size of a log file exceeds this amount, another log file will be created.
  • LogFormat: Shows what should be put on each line of the log file. The mentioned value in the attribute above shows a time stamp (date + time) and the message that is passed from Damaris.
  • LogLevel: Controls the amount of logging. The available values are trace, debug, info, warning, error, fatal. Where the scale involved goes from trace, that will log as much as possible to fatal that will log the least amount. Timing data for the server cores is enabled at info level.

From Damaris version 1.5.0 a Flush attributes has been added :

  • Flush: flush the log file to disk on each iteration, otherwise only at the end of the simulation. It has a default of False (do not flush every iteration)

Note: Currently, only the entry points of Damaris API is equipped with logging. If you need more detailed logging in the code, you will need to put your own logs inside the code.

Comments are closed.