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.

  • 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'.


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

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