Search

Chapter 13. Managing log files

download PDF

Red Hat Process Automation Manager manages the required maintenance, runtime data that is removed, including:

  • Process instance data, which is removed upon process instance completion.
  • Work item data, which is removed upon work item completion.
  • Task instance data, which is removed upon completion of a process to which the given task belongs.

Runtime data, which is not cleaned automatically includes session information data that is based on the selected runtime strategy.

  • Singleton strategy ensures that runtime data of session information is not automatically removed.
  • Per request strategy allows automatic removal when a request is terminated.
  • Per process instances are automatically removed when a process instance is mapped to a session that is completed or aborted.

In order to keep the track of process instances, Red Hat Process Automation Manager provides audit data tables. There are two ways to manage and maintain the audit data tables, including cleaning up the jobs automatically and manually.

13.1. Setting up automatic cleanup job

You can set up an automatic cleanup job in Business Central.

Procedure

  1. In Business Central, go to Manage > Jobs.
  2. Click New Job.
  3. Enter values for Business Key, Due On, and Retries fields.
  4. Enter the following command into the Type field.

    org.jbpm.executor.commands.LogCleanupCommand
  5. To use the parameters, complete the following steps:

    For full parameters list, see Section 13.3, “Removing logs from the database”.

    1. Open the Advanced tab.
    2. Click Add Parameter.
    3. Enter a parameter in the Key column and enter a parameter value in the Value column.
  6. Click Create.

The automatic cleanup job is created.

13.2. Manual cleanup

To perform manual cleanup, you can use the audit API. The audit API is divided into the following areas:

Table 13.1. Audit API areas
NameDescription

Process audit

It is used to clean up process, node and variable logs that are accessible in the jbpm-audit module.

For example, you can access the module as follows: org.jbpm.process.audit.JPAAuditLogService

Task audit

It is used to clean up tasks and events that are accessible in the jbpm-human-task-audit module.

For example, you can access the module as follows: org.jbpm.services.task.audit.service.TaskJPAAuditService

Executor jobs

It is used to clean up executor jobs and errors that are accessible in the jbpm-executor module.

For example, you can access the module as follows: org.jbpm.executor.impl.jpa.ExecutorJPAAuditService

13.3. Removing logs from the database

Use LogCleanupCommand executor command to clean up the data, which is using the database space. The LogCleanupCommand consists of logic to automatically clean up all or selected data.

There are several configuration options that you can use with the LogCleanupCommand:

Table 13.2. LogCleanupCommand parameters table
NameDescriptionIs Exclusive

SkipProcessLog

Indicates whether process and node instances, and process variables log cleanup is skipped when the command runs. The default value is false.

No, it is used with other parameters.

SkipTaskLog

Indicates if the task audit and event log cleanup are skipped. The default value is false.

No, it is used with other parameters.

SkipExecutorLog

Indicates if Red Hat Process Automation Manager executor entries cleanup is skipped. The default value is false.

No, it is used with other parameters.

SingleRun

Indicates if a job routine runs only once. The default value is false.

No, it is used with other parameters.

NextRun

Schedules the next job execution. The default value is 24h.

For example, set to 12h for jobs to be executed every 12 hours. The schedule is ignored if you set SingleRun to true, unless you set both SingleRun and NextRun. If both are set, the NextRun schedule takes priority. The ISO format can be used to set the precise date.

No, it is used with other parameters.

OlderThan

Logs that are older than the specified date are removed. The date format is YYYY-MM-DD. Usually, this parameter is used for single run jobs.

Yes, it is not used with OlderThanPeriod parameter.

OlderThanPeriod

Logs that are older than the specified timer expression are removed. For example, set 30d to remove logs, which are older than 30 days.

Yes, it is not used with OlderThan parameter.

ForProcess

Specifies process definition ID for logs that are removed.

No, it is used with other parameters.

RecordsPerTransaction

Indicates the number of records in a transaction that is removed. The default value is 0, indicating all the records.

No, it is used with other parameters.

ForDeployment

Specifies deployment ID of the logs that are removed.

No, it is used with other parameters.

EmfName

Persistence unit name that is used to perform delete operation.

Not applicable

Note

LogCleanupCommand does not remove any active instances, such as running process instances, task instances, or executor jobs.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.