Getting Started section should be sufficient to get comprehensive
logging for all user code executed and calls into libraries in site-packages and python libs
(which by default are configured to show just when called from user code and will
not show internal calls inside the library itself).
It's possible to change how libraries or user code is logged by customizing
by creating a
There are three different logging configurations that may be applied for each module:
exclude: excludes a module from logging.
full_log(default for user code): logs a module with full information, such as method calls, arguments, yields, local assigns, and more.
log_on_project_call(default for library code -- since 2.0): logs only method calls, arguments, return values and exceptions, but only when a library method is called from user code. This configuration is meant to be used for libraries (modules in site-packages or python lib) logging.
Example showing how to exclude from logging any user module which ends with
By default libraries in site-packages and python lib will be configured as
it's possible to change its default through
pyproject.toml where the
libraries are configured to be logged and all other libraries in site-packages/python lib are
excluded by default:
Note that when specifying a module name to match in
the name may either match exactly or the module name must start with the
name followed by a dot.
This means that, for example,
RPA would match
robocorp-tasks 2.0, it's also possible to use
fnmatch style names
* matches anything and
? matches any single char -- see: https://docs.python.org/3/library/fnmatch.html for more information).
Note that the order of the rules is important as rules which appear first are matched before the ones that appear afterwards.
By default, the log output will be saved to an
output directory, where each file
can be up to
1MB and up to
5 files are kept before old ones are deleted.
When the run finishes, a
log.html file will be created in the output directory
containing the log viewer with the log contents embedded.
However, you can customize the log output by changing the output directory,
maximum number of log files to keep, and maximum size of each output file.
You can do this through the command line by passing the appropriate arguments
python -m robocorp.tasks run.
For example, to change the output directory to
You can also set the maximum number of output files to keep by passing
--max-log-files followed by a number. For example, to keep up to
10 log files, run:
Finally, you can set the maximum size of each output file by passing
--max-log-file-size followed by a size in megabytes (e.g.:
For example, to set the maximum size of each output file to