How to enable DEBUG logs for Container Service plugin code (logback + remote debug)

0 views
Skip to first unread message

Richard Guo

unread,
Oct 9, 2025, 9:29:56 AM (4 days ago) Oct 9
to xnat_discussion

Dear XNAT Discussion Group,

Environment
• XNAT running on Kubernetes (namespace: ais-xnat), plugin: Container Service
• Logs present: containers.log (+ rotated files)
• Problem: I added SLF4J statements in Container Service–related classes (e.g., log.debug("...")), but I cannot see any DEBUG lines in containers.log or other container-service logs. VS Code remote debugging has also not attached successfully yet.

What I have tried

  1. Verified code uses SLF4J (org.slf4j.LoggerFactory) and the package is under org.nrg.containers....

  2. Enabled loggers in $XNAT_HOME/config/logback.xml and restarted Tomcat/XNAT:
    • org.nrg.containers at DEBUG
    • org.nrg.containers.api at DEBUG
    • org.nrg.containers.services at DEBUG
    • org.nrg.containers.kubernetes at DEBUG

  3. Confirmed appender routing: the same appender used for containers.log should capture these categories.

  4. Reproduced the workflow (cache-recall / dcm2niix launch), but DEBUG lines did not appear.

  5. Searched with grep -rni DEBUG containers.log* and monitored with tail -f containers.log.

Questions

  1. Are there additional logger categories I should enable for Container Service (or command resolution) to surface DEBUG output? For example, org.nrg.framework, org.nrg.xnatx.plugins, or others used by the plugin?

  2. Is there a recommended, up-to-date sample logback.xml snippet for enabling full Container Service DEBUG in XNAT 1.9.x?

  3. For remote debugging on Kubernetes: is the approach below correct?
    • Set JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" on the xnat-web container
    • Expose containerPort 5005 and kubectl port-forward svc/xnat-web-debug 5005:5005
    • Attach VS Code on localhost:5005 with sources matching the deployed JAR

  4. Does the Container Service plugin route some logs through a different category or level (e.g., INFO only) during orchestration steps, which could explain why log.debug lines do not appear?

  5. If there is a known interaction with shaded logging bindings in the plugin JAR, what is the recommended fix?

If helpful, I can share:
• A minimal code snippet with the log.debug call and its package/class name
• My current logback.xml relevant sections (logger + appender)
• The exact Container Service version and XNAT version

Many thanks for any guidance or a canonical logging/debug configuration.

Kind regards,
Chenxi (Richard) Guo

Reply all
Reply to author
Forward
0 new messages