Worklist Plugin Logging

Hi Team,

I have noticed that as of orthancteam/orthanc:24.6.1 when plugin log level is set to verbose, the worklist plugin prints nothing to the orthanc logs. The query succeeds, but nothing is printed to the logs.

However a query to the image orthancteam/orthanc:24.5.1 will print the logs to the container logs.

James

Hi James,

We have indeed slightly modified logging wrt plugins in 1.12.4. The change allows us to log the plugin name, plugin file name and line number in the logs so if I run:

docker run -p 4243:4242 -e WORKLISTS_PLUGIN_ENABLED=true -e VERBOSE_ENABLED=true -e ORTHANC__DICOM_ALWAYS_ALLOW_FIND_WORKLIST=true orthancteam/orthanc:24.6.1

and

findscu -v -W  -k "PatientName=" -k "(0040,0100)[0].Modality=MR" localhost 4243

I get logs from the worklist plugin since I have enabled verbose logs in general:

I0612 15:32:11.174419          DICOM-1 worklists:/Plugin.cpp:81] Received worklist query from remote modality FINDSCU:
{
        "0010,0010" : "",
        "0040,0100" : 
        [
                {
                        "0008,0060" : "MR"
                }
        ]
}

E0612 15:32:11.174584          DICOM-1 worklists:/Plugin.cpp:201] Inexistent folder while scanning for worklists: /var/lib/orthanc/worklists

But, indeed, if I enable only the plugins category logs at verbose level:

docker run -p 4243:4242 -p 8043:8042 -e WORKLISTS_PLUGIN_ENABLED=true  -e ORTHANC__DICOM_ALWAYS_ALLOW_FIND_WORKLIST=true orthancteam/orthanc:24.6.1
curl -u orthanc:orthanc -X PUT http://localhost:8043/tools/log-level-plugins -d "verbose"

I only get the error logs and not the info level.

This happens because, with the new logging primitives, the plugins are now able to use other categories than the plugins one but, by default, they are now using the generic category.

@jodogne, is there a C++ define that we could use to detect if we are using the Orthanc Framework from a plugin and therefore, define another default value LogCategory_PLUGINS for the category in LOG() functions ?

#  define LOG(level)     ::Orthanc::Logging::InternalLogger             \
  (::Orthanc::Logging::LogLevel_ ## level,                              \
   ::Orthanc::Logging::LogCategory_GENERIC, NULL /* no plugin */,       \
   __ORTHANC_FILE__, __LINE__)

Thanks for responding so quickly and the explanation. Interestingly the Accelerated Transfers Plugin in 1.12.4 still logs when the plugin log level is verbose. I’m guessing that might be because that plugin was complied with an older version of the OrthancSDK.

I suppose the longer term solution might be to allow the Rest API to configure the log level for specific categories, allowing fine grained control for arbitrary logging categories?

Yes, that correct.

It seems it is already implemented no ? Collecting logs — Orthanc Book documentation