Allow INFO, DEBUG, and TRACE level logging to occur
I may be missing something obvious, but there is nothing I can do to get any of my INFO, DEBUG, and TRACE level logging to appear in the Console when I am developing in Iniz. I see there are some aspects of the codebase that are hard-coding WARN levels, which I suspect is the issue, though I haven't been able to successfully undo that.
In general, we should not be hard-coding any particular logging. If we want to support a separate initializer.log file that focuses only on the WARN messages from Iniz, this should be something that is possible without affecting other appenders and logging mechanisms.
@mks-d thoughts? This may be related to #67 though not 100% clear.
@mseaton you meant this? https://github.com/mekomsolutions/openmrs-module-initializer/blob/a10d37e6990827edf37a60a4c51c3fe76d3978f9/api/src/main/java/org/openmrs/module/initializer/InitializerActivator.java#L47
And yes, I agree that having all this configurable externally would definitely be better.
@mks-d yes, that's what I'm referring to. The Validator.java class also has a "setupLog4j" method that manipulates things to hard-code to WARN messages as well. Some of this is likely OK, but what I've found is that I can't get any logging to appear in the console unless I use WARN levels, which is hard for development, as it means I either avoid logging or I have to do big copy/replace operations before I commit.
This seems like it might be getting addressed in PR #215 ? @mks-d and @icrc-fdeniger , should we link that PR to this ticket? Will that address the concerns laid out above?
in the first comment you mention the Console. The PR #215 deals with the appender that will write logs to the file intializer.log so not sure it's totally related to this issue.
The PR tries to fix a bug with the new properties initializer.logging.*: only logs with the specified level are appended to the log file.
For your issue, I would expect to have a dedicated log4j config file that will be used in dev mode
For your issue, I would expect to have a dedicated log4j config file that will be used in dev mode
@icrc-fdeniger do you mean that there is a workaround and that this issue could be closed?
IMHO this issue is still here. This line: https://github.com/mekomsolutions/openmrs-module-initializer/blob/a10d37e6990827edf37a60a4c51c3fe76d3978f9/api/src/main/java/org/openmrs/module/initializer/InitializerActivator.java#L47 will prevent displaying INFO, DEBUG, and TRACE level logging as mentionned by mseaton.
@icrc-fdeniger That's a much older version of the activator. We currently change the logging level to whatever the value of initializer.logging.level is. See here. (That was part of #181, so the change that #215 is a fix for).
yes sorry. I believe I was on the main branch but no...