Am working on a ticket that requires custom module logging . is there currently a way we can have a module do logging in a separate file ,without adjusting the log config
in the openmrs core??
i would want some thing like this placed in a module , rather than adjusting the core’s log config
hello @k.joseph, i have looked at that talk thread. But it seems your advise was to add the custom module log config , to the openmrs core log4j config file. please correct me if I have misunderstood the suggestion you gave .
am not sure if log4j2 supports multiple configuration files but my search seems not to suggest that it does, the quickest way would be adding your appender in the openmrs log4js configuration file
not sure, i think multiple config files weren’t supported when i looked into this, am not sure if it is right now.
if this was an implementation specific thing, i would improvise by a symbolic link (ln -s) to a clone of the same config file in openmrs so that the existing one points to my other one (clone) that adds my other appenders;
i have not tried this out;
java.nio.file.Files.createSymbolicLink(symLinkPath, existingFilePath); not sure if it can help. you could try it in your module’s activator.
@mksd , i used a symbolic link and it worked. just that later i discovered , custom logging was already implemented , and i only had to add a user interface component to search and view the logs
@ivange94 , i was working onthis ticket https://issues.openmrs.org/browse/REPORT-770?filter=-1
which required creatint a custom looging for the repoerting module and also adding a UI componentfor the logs. but i discovered work on creating the custom logging had already been done , and i only had to create a UI component for the module
@mksd i was not necesarilly talking modules that do custom logging like that one , my task was to specifically make the reporting module do some custom logging, to log therepoerting activities.
@ivange94, are you exactly asking about the reporting module doing custom logging ?? but it only does its own logging for the reporting activities, not that it can support other modules to also do custom logging
@mozzy this ticket was closed with no commits made.
Anyway the answer is that we are not interested in custom logging specifically in the Reporting module. Ideally we would want this for any module upon configuration.
ya that true , no commits were made , but in the comments,
@mseaton gave directives on how it was done , and it is what i used to build upon to work on this ticket Issue navigator - OpenMRS Issues