Ticket #255 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Unified Logger - activity log updates not recorded correctly

Reported by: jdalbey Owned by: jdalbey
Priority: High Milestone: May 2021 Training
Component: Unified Logger Version:
Severity: Major Keywords:
Cc:

Description

Not positive about this, but it seems like new entries in data.json aren't appearing in unified log. I think because the activity logger currently appends data_summary.json to data.json before checking for new items, and because the item that gets reported is the last one (which is a data_summary record) only a "new incident" is reported even if the actual new item was a data.json item.

Change History

comment:1 Changed 5 years ago by jdalbey

Steps to reproduce:
On a development machine, Open a terminal in the repository trunk:
% python src/python/unifiedlogger/activitylog_watcher.py
Observe the log messages that appear.
In webapps/dynamicdata/data.json, manually add a new entry. Save and watch the terminal window. Within five seconds, the last line (for a "new" incident) will appear again, instead of a line for the new data.json event.

comment:2 Changed 5 years ago by jdalbey

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r644.
Refactored and updated the module so that it reads each log file and tracks its length separately, then concatenates the results just before outputting the unifiedlog items. Created two helper functions, readFile1 and readFile2 to read the incident activity and incident description files (respectively). getLogEntries calls these two functions and then concatenates the two logs.

Also, changed the filenames the module expects for the data files:
data.json to incident_activity.json
data_summary.json to incident_description.json

Note: See TracTickets for help on using tickets.