oodt icon indicating copy to clipboard operation
oodt copied to clipboard

[OODT-1021] Unify Logging through SLF4J

Open yasithdev opened this issue 6 years ago • 7 comments

There are multiple logging APIs used in OODT at the moment, including JUL and Log4J. There has been some progress converting them to SLF4J and adding SLF4JBridge to ease the migration. However, in components such as Filemgr, logs do not appear on Console and only gets written to log files, making it hard to debug OODT overall.

Please note that this PR is an extensive overhaul and includes changes in 300+ source files. However, all changes are related to migrating to SLF4J APIs and includes few additional logs in filemg

yasithdev avatar Aug 21 '19 08:08 yasithdev

I like this PR, the logging in OODT has always been a right PITA trying to find the right stuff in the right file/console output. I'm very much +1 to this.

buggtb avatar Aug 29 '19 08:08 buggtb

@yasithmilinda really sorry I did not see this patch. Are you able to update against master branch? I will review. Sorry about this...

lewismc avatar Jan 24 '21 19:01 lewismc

Hello @lewismc and @buggtb, it's been a while since I added this PR. I'll give it a shot this week and see where I get.

yasithdev avatar Jan 25 '21 13:01 yasithdev

@lewismc, I've updated it against the master branch. Appreciate if you can review it. Cheers!

yasithdev avatar Jan 27 '21 10:01 yasithdev

@yasithmilinda Thanks for updating the PR. Were you able to do some quick tests with this? Like building OODT pack and running everything to see if log files are created as expected?

@lewismc since this is just a logging change, do you think this won't break anything?

IMS94 avatar Jan 27 '21 12:01 IMS94

@IMS94 I only ran basic tests by creating a new project from the radix archetype. I'm not entirely sure which log files are expected to be created. Can you point me to a sample workflow (or instructions) that I can run this PR and test on?

yasithdev avatar Jan 28 '21 05:01 yasithdev

@yasithmilinda You can simply build the OODT distribution and, run oodt start. Check if all the services (filemgr, resmgr and workflow manager) comes up without an issue (you can use the status page to see if services are running). Then, if all are running, you can check if the log files are created under ${component_directory}/logs folder (ex: filemgr/logs).

My only concern is, when running, say file manager, that shell script passes in the logging.properties file which is for JUL. When we were using JUL within the applications, this works fine. Now, when we have changed the logging within applications to slf4j (log4j2), we are not providing a log4j2.xml in that shell script (correct me if I'm wrong). This may cause the logs to not be printed properly in the log files. However, I remember I did some log4j2 migration sometime back, in which I added the log4j2.xml files and used the log4j2 jul adapter to print JUL logs in log4j2 log outputs. It will be great if you can double check. If log4j2.xml is there, then your changes will work without any issue.

IMS94 avatar Jan 29 '21 04:01 IMS94