Logger

更新时间:
复制 MD 格式

You can record logs generated by an application in two ways:

  • Method 1: Use the built-in Python print() method. Logs are recorded only locally.

  • Method 2: Use the methods provided by rpa.console.logger.

Important

Classify application logs to simplify future Operations and Maintenance (O&M) and troubleshooting.

  • Use the print() or rpa.console.logger.debug() method to record operational logs, such as execution progress, locally.

  • Use rpa.console.logger.info(), rpa.console.logger.warn(), and rpa.console.logger.error() to record important information, such as caught exceptions, both locally and on the server-side.

To view logs recorded locally, you can find the corresponding files on your system. For more information, see View robot client logs.

You can view logs uploaded to the server-side in the console.

Warning

The server-side has the following limits for uploaded logs:

  • If the upload frequency is too high, automatic throttling is triggered.

  • In the console, you can view operational logs only for running tasks or for tasks that have finished in the last 3 days.

debug

debug(values)

Description

Logs are recorded only locally.

Example: rpa.console.logger.debug

# Note: This method accepts multiple arguments and outputs them as a single string to the log panel.
# Example:
rpa.console.logger.debug('RPA-Logger' , 'Type is debug')

info

info(values)

Description

Logs are recorded locally and on the server-side.

Example: rpa.console.logger.info

# Note: This method accepts multiple arguments and outputs them as a single string to the log panel.
# Example:
rpa.console.logger.info('RPA-Logger' , 'Type is info')

warn

warn(values)

Description

Logs are recorded locally and on the server-side.

Example: rpa.console.logger.warn

# Note: This method accepts multiple arguments and outputs them as a single string to the log panel.
# Example:
rpa.console.logger.warn('RPA-Logger' , 'Type is warn')

error

error(values)

Description

Logs are recorded locally and on the server-side.

Example: rpa.console.logger.error

# Note: This method accepts multiple arguments and outputs them as a single string to the log panel.
# Example:
rpa.console.logger.error('RPA-Logger' , 'Type is error')