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:
filepathstr

Filename of the log.

appendbool

When True, appends to an existing log file. When False, overwrites the log file if it already exists.

levelstr

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')