NHMDenmark / DaSSCo-Integration

This Repo will include integration of dassco storage from northtec
0 stars 0 forks source link

Logging system #88

Open Baeist opened 1 month ago

Baeist commented 1 month ago

We are using the "logging" library.

We are logging events on two different levels: warnings and errors. This can be expanded as needed.

When we log something it gets put into a logging file belonging to the service that logged it. It will also be send to the health api, from where further processing and information sharing will be handled.

We are logging as much detail as possible since these logs are mainly for technical eyes. Example of an log entry: ERROR:2024-05-31 10:06:47,983:xd.py:message from devs:(<class 'FileNotFoundError'>, FileNotFoundError(2, 'No such file or directory'), <traceback object at 0x000001D8EAF92D00>) Traceback (most recent call last): File "c:\Users\tvs157\Desktop\VSC_projects\LoggingExperimentation\main.py", line 67, in with open("/shda") as f: ^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/shda'

So it consists of the level of severity, timestamp, file that logged it, any message we decide to put, any exception caught.

Baeist commented 3 weeks ago

Logging is implemented in all services except for ndrive_new_files.py and process_files_from_ndrive.py.

Logging is also not implemented for any APIs.

Baeist commented 3 weeks ago

Implemented for the ndrive services also.