Logging and debugging

Logging and debugging operations are performed through the dicm Engine Output module and Dcmtk logging.

dicm Engine Output module submodules:

  • init: Initialization
  • open: Open a file or make a connection
  • read: Read data
  • write: Write data
  • close: Close a file or connection

For example:

[dicm:init:INFO/1:   CL_SCP:09/05/2014 03:58:00] Initializing
[dicm:open:DBUG/0:   CL_SCP:09/05/2014 03:58:00] scp using local port:11112
[dicm:read:INFO/1:   CL_SCP:09/05/2014 03:58:05] Reading
[dicm:wrte:INFO/1:   CL_SCP:09/05/2014 03:58:07] Writing
[dicm:clse:INFO/1:   CL_SCP:09/05/2014 03:58:16] Shutting down

Dcmtk logging

This provides logging detail levels:

  • disable
  • fatal
  • error
  • warn
  • info
  • debug
  • trace

The configuration is saved in NetConfig:

 { PROTOCOL {
    { DICOMEO trace }
….

Dcmtk logging is useful in checking the raw data received/sent by Cloverleaf and debugging the entire DICOM message transferring process. For example:

D: setting network send timeout to 60 seconds
D: setting network receive timeout to 60 seconds
T: DUL  FSM Table: State: 1 Event: 4
T: DUL  Event:  Transport connection indication
T: DUL  Action: AE 5 Transport Connect Response
T: Read PDU HEAD TCP: 01 00 00 00 01 40
T: Read PDU HEAD TCP: type: 01, length: 320 (140)
T: DUL  FSM Table: State: 2 Event: 5
T: DUL  Event:  A-ASSOCIATE-RQ PDU (on transport)
T: DUL  Action: AE 6 Examine Associate Request
D: PDU Type: Associate Request, PDU Length: 320 + 6 bytes PDU header
D:   01  00  00  00  01  40  00  01  00  00  44  49  43  4f  4d  54
D:   45  53  54  20  20  20  20  20  20  20  53  54  4f  52  45  53
D:   43  55  20  20  20  20  20  20  20  20  00  00  00  00  00  00
D:   00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
……

This shows association information, including A-ASSOCIATE-RQ and A-ASSOCIATE-AC.

D: ====================== BEGIN A-ASSOCIATE-RQ =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.1
D: Our Implementation Version Name:   OFFIS_DCMTK_361
D: Their Implementation Class UID:    1.2.40.0.13.1.1
D: Their Implementation Version Name: dcm4che-3.3.3
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    STORESCU
D: Called Application Name:     DICOMTEST
D: Responding Application Name: 
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  16378
D: Presentation Contexts:
D:   Context ID:        1 (Proposed)
D:     Abstract Syntax: =VerificationSOPClass
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianImplicit
D:   Context ID:        3 (Proposed)
D:     Abstract Syntax: =MRImageStorage
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =LittleEndianImplicit
D:   Context ID:        5 (Proposed)
D:     Abstract Syntax: =MRImageStorage
D:     Proposed SCP/SCU Role: Default
D:     Proposed Transfer Syntax(es):
D:       =JPEG2000
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-RQ ======================
T: DUL  FSM Table: State: 3 Event: 6
T: DUL  Event:  A-ASSOCIATE resp prim (accept)
T: DUL  Action: AE 7 Send Associate AC
D: Constructing Associate AC PDU
D: pdDICOMDcmSCP: Association Acknowledged
I: Association Acknowledged (Max Send PDV: 16366)
D: ====================== BEGIN A-ASSOCIATE-AC =====================
D: Our Implementation Class UID:      1.2.276.0.7230010.3.0.3.6.1
D: Our Implementation Version Name:   OFFIS_DCMTK_361
D: Their Implementation Class UID:    1.2.40.0.13.1.1
D: Their Implementation Version Name: dcm4che-3.3.3
D: Application Context Name:    1.2.840.10008.3.1.1.1
D: Calling Application Name:    STORESCU
D: Called Application Name:     DICOMTEST
D: Responding Application Name: DICOMTEST
D: Our Max PDU Receive Size:    16384
D: Their Max PDU Receive Size:  16378
D: Presentation Contexts:
D:   Context ID:        1 (Accepted)
D:     Abstract Syntax: =VerificationSOPClass
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianImplicit
D:   Context ID:        3 (Accepted)
D:     Abstract Syntax: =MRImageStorage
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =LittleEndianImplicit
D:   Context ID:        5 (Accepted)
D:     Abstract Syntax: =MRImageStorage
D:     Proposed SCP/SCU Role: Default
D:     Accepted SCP/SCU Role: Default
D:     Accepted Transfer Syntax: =JPEG2000
D: Requested Extended Negotiation: none
D: Accepted Extended Negotiation:  none
D: Requested User Identity Negotiation: none
D: User Identity Negotiation Response:  none
D: ======================= END A-ASSOCIATE-AC ======================

In additiion to the hex raw data, it also shows human readable data.

T: # Dicom-Data-Set
T: # Used TransferSyntax: Little Endian Implicit
T: (0000,0002) UI =MRImageStorage     # 26, 1 AffectedSOPClassUID
T: (0000,0100) US 1                   #  2, 1 CommandField
T: (0000,0110) US 1                   #  2, 1 MessageID
T: (0000,0700) US 0                   #  2, 1 Priority
T: (0000,0800) US 0                   #  2, 1 CommandDataSetType
T: (0000,1000) UI [1.3.12.2.1107.5.2.5.11090.5.0.5825067617589833] #  46, 1 AffectedSOPInstanceUID