How to view real-time DEBUG logs in XNAT without rebuilding the plugin

9 views
Skip to first unread message

Richard Guo

unread,
Oct 16, 2025, 2:21:11 AM (12 days ago) Oct 16
to xnat_discussion

Hi everyone,

I’m currently developing and debugging the Container Service plugin within an XNAT deployment running on Kubernetes.
At the moment, every time I add a new debug() line in the Java code, I have to rebuild the plugin JAR, redeploy it into the XNAT environment, and then check the updated containers.log inside the pod (via kubectl exec).

This workflow is very time-consuming. I’m wondering if there’s a better way to view new DEBUG log outputs in real time without rebuilding the plugin each time.

Specifically:

  • Is there a recommended way to dynamically change the logging level for the Container Service (e.g., via containers-logback.xml, JMX, or another mechanism)?

  • Can I reload or hot-update the log configuration (e.g., set scan="true" in logback.xml) while XNAT is running?

  • Alternatively, are there best practices to stream live logs from the Container Service during development or to hot-swap new code for testing without a full rebuild?

Any advice or example configuration from others who develop XNAT plugins in similar environments (e.g., Docker or Kubernetes) would be greatly appreciated.

Thanks in advance,
Chenxi

Mohana Ramaratnam

unread,
Oct 16, 2025, 2:25:20 AM (12 days ago) Oct 16
to xnat_di...@googlegroups.com
Hello,

If you are using XNAT 1.9.2, we have added ability to view and change the log levels without a tomcat restart. 

See Release notes here

Unfortunately, you would still have to rebuild and deploy your plugin.

Regards,
Mohana

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xnat_discussion/0654d18c-d18d-4236-bc27-298c6a8e2f81n%40googlegroups.com.

Mohana Ramaratnam

unread,
Oct 16, 2025, 2:26:05 AM (12 days ago) Oct 16
to xnat_di...@googlegroups.com
Hello,

If you are using XNAT 1.9.2, we have added the ability to view and change the log levels without a tomcat restart. 


See Release notes here

Unfortunately, you would still have to rebuild and deploy your plugin.

Regards,
Mohana
Regards,
Mohana Ramaratnam,

 moh...@xnatworks.io
 xnatworks.io | Find us on LinkedIn


On Thu, Oct 16, 2025 at 11:51 AM Richard Guo <84032...@gmail.com> wrote:
--

John Flavin

unread,
Oct 17, 2025, 12:00:15 PM (10 days ago) Oct 17
to xnat_di...@googlegroups.com
In addition to what Mohana said about the log levels, it is possible to "hot swap" the code in a jar, meaning you make local changes to the source code and those changes are updated in the running application without the explicit compile and restart steps. But it has been a long time since I've done that, so I can't give any kind of detailed guide. If you’re using an IDE for java development they will likely have tools to help set that up. And others on this board might have done this more recently and could give better advice.

John Flavin

Richard Guo

unread,
Oct 19, 2025, 8:10:17 PM (8 days ago) Oct 19
to xnat_di...@googlegroups.com
Much appreciated Dear Mohana~, I am reading the new changed for XNAT 1.9.2

Richard Guo

unread,
Oct 19, 2025, 8:11:10 PM (8 days ago) Oct 19
to xnat_di...@googlegroups.com
Much appreciated Dear John, I am currently using VSC to do the debug but still viewing the containers.log from kubernetes instance, I am looking forward to one way to figure this out in the future~

Reply all
Reply to author
Forward
0 new messages