add_file_handler

Mapdl.add_file_handler(filepath, append=False, level='DEBUG')

Add a file handler to the mapdl log. This allows you to redirect the APDL logging to a file.

Parameters
  • filepath (str) – Filename of the log.

  • append (bool) – When True, appends to an existing log file. When False, overwrites the log file if it already exists.

  • level (str) – Log level. Must be one of: 'DEBUG', 'INFO', 'WARNING', 'ERROR'.

Examples

Start writing the log to a new file named “mapdl.log”

>>> mapdl.add_file_handler('mapdl.log')