tazama-lf / General-Issues

This repo exists to track current work and any issues within the FRMS CoE
2 stars 0 forks source link

Log operations in libraries #385

Open rtkay123 opened 8 months ago

rtkay123 commented 8 months ago

Story statement

As a platform maintainer/developer I want structured logging in libraries **So that I have feedback on operations occurring in libraries

Acceptance criteria

  1. frms-coe-lib can utilise the platform logger to report on the tasks it's performing.

Motivation

The frms-coe-lib caches rule configs after the first database lookup. This means there are two potential sources of the rule config, from cache, or from the database. Because there aren't any log statements in the library, callers of the library's methods have no way to tell where particular data comes from (if it can come from multiple places). For example, getRuleConfig() first checks cache and then does a database lookup.

We could have log statements that provide feedback in which path of execution was followed: In the case of cache:

loggerService.log('querying local cache for rule config abc')

And then in the case of database lookup

loggerService.log('querying database for rule config abc')

if we know and can report on what is happening in the libraries, it may work towards identifying the causes for https://github.com/frmscoe/General-Issues/issues/360