changeset 4620:926fa5ef8b4f

added remote AET and IP in verbose logs about DICOM networking
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 15 Apr 2021 11:29:40 +0200
parents 57b1a36645ae
children 82dbe45c947a 844ec5ecb6ef
files OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp
diffstat 1 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp	Wed Apr 14 12:08:20 2021 +0200
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp	Thu Apr 15 11:29:40 2021 +0200
@@ -654,9 +654,15 @@
           AssociationCleanup(assoc);
           return NULL;
         }
-        CLOG(INFO, DICOM) << "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength << ")";
-        if (ASC_countAcceptedPresentationContexts(assoc->params) == 0)
-          CLOG(INFO, DICOM) << "    (but no valid presentation contexts)";
+
+        {
+          std::string suffix;
+          if (ASC_countAcceptedPresentationContexts(assoc->params) == 0)
+            suffix = " (but no valid presentation contexts)";
+          
+          CLOG(INFO, DICOM) << "Association Acknowledged (Max Send PDV: " << assoc->sendPDVLength
+                            << ") to AET " << remoteAet << " on IP " << remoteIp << suffix;
+        }
 
         {
           OFString str;
@@ -908,24 +914,26 @@
         // the peer or a network error
         finished = true;
 
-        CLOG(INFO, DICOM) << cond.text();
+        CLOG(INFO, DICOM) << "Finishing association with AET " << remoteAet_
+                          << " on IP " << remoteIp_ << ": " << cond.text();
       }
     
       if (finished)
       {
         if (cond == DUL_PEERREQUESTEDRELEASE)
         {
-          CLOG(INFO, DICOM) << "Association Release";
+          CLOG(INFO, DICOM) << "Association Release with AET " << remoteAet_ << " on IP " << remoteIp_;
           ASC_acknowledgeRelease(assoc_);
         }
         else if (cond == DUL_PEERABORTEDASSOCIATION)
         {
-          CLOG(INFO, DICOM) << "Association Aborted";
+          CLOG(INFO, DICOM) << "Association Aborted with AET " << remoteAet_ << " on IP " << remoteIp_;
         }
         else
         {
           OFString temp_str;
-          CLOG(INFO, DICOM) << "DIMSE failure (aborting association): " << cond.text();
+          CLOG(INFO, DICOM) << "DIMSE failure (aborting association with AET " << remoteAet_
+                            << " on IP " << remoteIp_ << "): " << cond.text();
           /* some kind of error so abort the association */
           ASC_abortAssociation(assoc_);
         }