DicomObjects.NET.8.48 Documentation
DicomObjects Namespace / DicomGlobal Class / LogToFile Method / LogToFile(String,Int32) 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
Example

In This Topic
    LogToFile(String,Int32) Method
    In This Topic
    Enables DicomObjects logging to a user provided stream
    Syntax
    'Declaration
     
    
    Public Overloads Shared Sub LogToFile( _
       ByVal Path As System.String, _
       ByVal LogLevel As System.Integer _
    ) 
    public static void LogToFile( 
       System.string Path,
       System.int LogLevel
    )

    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
    Remarks

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

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

    Target Platforms: .NET CLR 4.8 or higher

    See Also