DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomServer Class / LogToFile Method

The location of the log files.

If an empty string being passed, DicomObjects will use "C:\" as the default location.

But still it is the container's responsibility to ensure either that the path is valid and correct.

This value controls the level of details logged either to the display, or to a file.

The allowable values for log level are:

Decimal Hex
1 1 Errors
2 2 Warnings
4 4 Informational Messages
8 8 Detailed Logging
16 10 All DICOM attributes received or read
32 20 All DICOM attributes send or written
64 40 Byte-Level data received, except contents of data PDUs
128 80 Byte-level data sent, except contents of data PDUs
256 100 All bytes received
512 200 All bytes sent
The beginning of the log file name to differentiate different DicomServer instance logs

RestartMinutes as int, the time interval when a new log file should be generated.

Example

In This Topic
    LogToFile Method (DicomServer)
    In This Topic
    Enables DicomServer instance specific logging, specifies where DicomObjects log files appear, what the logging level is and the timer interval when new log file should be generated. This will create the subset of the main DicomGlobal.LogToFile log that only concerns this instance of DicomServer
    Syntax
    'Declaration
     
    
    Public Sub LogToFile( _
       ByVal path As System.String, _
       ByVal logLevel As System.Integer, _
       Optional ByVal logFileNamePrefix As System.String, _
       Optional ByVal restartMinutes As System.Integer _
    ) 
    public void LogToFile( 
       System.string path,
       System.int logLevel,
       System.string logFileNamePrefix,
       System.int restartMinutes
    )

    Parameters

    path

    The location of the log files.

    If an empty string being passed, DicomObjects will use "C:\" as the default location.

    But still it is the container's responsibility to ensure either that the path is valid and correct.

    logLevel

    This value controls the level of details logged either to the display, or to a file.

    The allowable values for log level are:

    Decimal Hex
    1 1 Errors
    2 2 Warnings
    4 4 Informational Messages
    8 8 Detailed Logging
    16 10 All DICOM attributes received or read
    32 20 All DICOM attributes send or written
    64 40 Byte-Level data received, except contents of data PDUs
    128 80 Byte-level data sent, except contents of data PDUs
    256 100 All bytes received
    512 200 All bytes sent
    logFileNamePrefix
    The beginning of the log file name to differentiate different DicomServer instance logs
    restartMinutes

    RestartMinutes as int, the time interval when a new log file should be generated.

    Remarks

    The last two levels should NOT be used routinely when images are being sent or received, as the quality of log data becomes unmanageable, and the system will probably run so slowly that connecting equipment will time-out.

    Other bits in the higher word are reserved for Medical Connections' use or future expansion.

    This overload is to provide users a means to restart the logging on a regular time basic. This method is useful to avoid log file end up being HUGE.

    Example
    string path = @"C:\Logs"; // replace with your log path
    int logLevel = 0x3F;
    int restartMinutes = 15;
    dicomServer.LogToFile(path, logLevel, restartMinutes);
    Requirements

    Target Platforms: .NET CLR 4.8 or higher

    See Also