Improve Process Log for more advanced logging options for Processes

Description

Motivation:

In iDempiere we many times implement processes, that take a long time to execute. At this moment we can write a process which produce in iDempiere log measures (how many data is processed 10/1000, the percentage, count of errors and error ration in percentage). ATM I can write this as iDempiere console log, which can be tracked by admin linux console or through iDempiere monitor in browser.

With this improvement our intention is to show the process progress and it’s metrics to end-users or key roles (they need to know the status of long running processes). This can be a dashboard content, where e.g. Print Format HTML report is continuously refreshed and display the prosecc status metrics as columns.

 

Solution:

Improve iDempiere Process Audit Log tab, which allows continuous update of custom metrics (implemented by developer and continuously updated by the running process in specified periods).

 

Implementation:

Based on analysis we suggest to implement this feature in the following key steps:

  • in ProcessInfo.java improve m_logs ArrayList to be an ordered HashMap

    • key should be Log_ID from ProcessInfoLog

  • implement method for assigning unique Log_ID 

    • e.g. get the biggest ID from DB and add +1

  • implement new logging methods in SvrProcess.java

    • add log and save to DB at the end (current functionality)

    • add log and save to DB immediately (e.g. define with a boolean parameter)

    • update an existing log (e.g. progress, error count)

Environment

None

Attachments

3

Activity

Carlos Ruiz 
December 14, 2023 at 2:56 PM

Pull request 2141

- can you please test that this pull request solves the problem you reported at ?

- can you please test that the functionality on this ticket keeps working fine with the UU as unique key instead of primary key?

Carlos Ruiz 
December 14, 2023 at 12:47 PM

Reopening this because of the findings on ticket

Migration from old versions is broken because this ticket made the column AD_PInstance_Log.AD_PInstance_Log_UU a primary key not nullable, and in every implementation this column will probably have null values until filled.

My notes from that ticket:

  • this ticket here introduced an anomaly in this table, because it made ad_pinstance_log_uu a primary key which is not nullable by definition, but in all our tables the uu column is nullable.

  • Maybe the fix would be to make it a unique nullable constraint instead of a primary key?

  • on the other hand - the dictionary definition of AD_PInstance_Log is wrong, the parent link columns must make a unique key. At this moment just AD_PInstance_Log.AD_PInstance_ID is defined as parent, but the complete key must be AD_PInstance_ID+Log_ID

Peter Takacs 
June 1, 2023 at 7:50 AM

Documentation page created:

Peter Takacs 
May 17, 2023 at 10:31 AM
(edited)

Hi , I’ve implemented the updateLog methods, and the saveLog methods return the AD_PInstance_Log_UU now, the PR is ready for review.

Peter Takacs 
May 15, 2023 at 2:21 PM

I would prefer to keep thing as simple as possible.

Yes, I agree. Ok thank you, I’ll try it this way.

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created April 26, 2023 at 2:34 PM
Updated February 1, 2024 at 12:04 PM
Resolved December 16, 2023 at 2:31 PM