log_to_file#

Logger.log_to_file(filename='pymapdl.log', level=10)#

Add file handler to logger.

Parameters:
filenamestr, optional

Name of the file where the logs are recorded. By default 'pymapdl.log'.

levelstr or int, optional

Level of logging. By default 'DEBUG'.

Return type:

None

Examples

Write to pymapdl.log in the current working directory.

>>> from ansys.mapdl.core import LOG
>>> import os
>>> file_path = os.path.join(os.getcwd(), 'pymapdl.log')
>>> LOG.log_to_file(file_path)