INFO - LoggingAdvice.invoke(115) |2019-01-08 14:16:42,270| In method AlertService.saveAlert. Arguments: Alert=Alert: #null,
INFO - LoggingAdvice.invoke(155) |2019-01-08 14:16:42,272| Exiting method saveAlert
in my logs. LoggingAdvice.java makes it look like the relevant class I need to set the log level for is org.openmrs.api. Does anyone know how to set the logging level for a class? Is that indeed the way to quiet down LoggingAdvice?
This is an oldie but goodie Looks like I created a ticket asking for this around 7 years ago - how time flies!
@burke / @dkayiwa is there any good reason for us not to have LoggingAdvice use it’s own logger that can be selectively controlled? I’ve never understood this.
That looks like it changes the global log level. I’d like to change it on a per-module basis. LoggingAdvice posts those “In method…” / “Exiting method…” messages to info (which I think is not a great choice — logs at that resolution should be at level debug at the very highest, probably better trace). I’d like info to be usable.
It might be possible to simply override the root logger in a log4j.xml file defined within your module’s resources. You should also be able to modify in code I think. Something like:
But fundamentally, whichever you choose, I’m not sure there is any way to turn off the annoying logging around these service methods without affecting all logging for classes within the org.openmrs.api packages or subpackages. I could be wrong.