다음을 통해 공유


추적 및 디버깅

TI(트랜잭션 통합자)는 WIP(Windows 시작 처리) 호출과 HIP(호스트 시작 처리) 호출에 대한 자세한 추적을 제공합니다. 이 추적은 추적해야 하는 내용을 설명하는 호스트 통합 추적 정의 파일(.hitd)과 함께 앱 구성 파일에서 추적을 사용하도록 설정하여 수행됩니다. hitd 파일을 통해 추적 기능을 켜고 끌 수 있습니다. 앱 구성 파일을 통해 추적을 켜고 끌 수도 있지만, TI 프로세스가 시작될 때만 앱 구성 파일을 읽을 수 있으므로 새 구성에 영향을 주려면 TI 프로세스를 다시 시작해야 합니다.

다음 지침에서는 추적 파일을 C:\Tracing 폴더에 저장하는 방법을 설정하는 방법을 보여 줍니다. 필요한 경우 다른 폴더를 사용할 수 있습니다. TI 프로세스를 실행하는 계정에 추적 폴더에 대한 읽기/쓰기 권한이 있어야 합니다.

  1. 추적 폴더 만들기, C:\Tracing

  2. HITD(호스트 통합 추적 정의 파일) 만들기

  3. 추적 뷰어 시작(HIS를 설치해야 합니다. 시작 - 실행 - histraceviewer

  4. 파일 메뉴에서 새 정의 파일을 선택합니다. TI_Trc02b1

  5. 트랜잭션 통합자 WIP 선택: TI_Trc_02c

  6. 추적 크기 및 선택: 각 구성 요소에 대해 추적 수준을 설정할 수 있습니다. 추적 수준이 더 높은 구성 요소에서 설정된 경우 해당 추적 수준은 하위 구성 요소에도 적용됩니다.

    • "추적 수준"을 마우스 오른쪽 단추로 클릭하고 "새 수준"을 선택합니다. TI_Trc_02d
    • 하나 이상의 수준을 선택하고 확인을 클릭합니다. TI_Trc_02e
    • 모든 옵션을 선택하면 확인을 클릭한 후 "ALL"이 반영됩니다. TI_Trc_02f
    • 새 HITD 파일을 C:\Tracing 디렉터리에 TI_Trace 저장합니다. 추적 뷰어를 닫습니다. TI_Trc_02g
  7. 추적 구성 정보로 애플리케이션 구성 파일을 업데이트합니다.

    Windows 시작 처리(WIP)의 경우, TI .Net 프로젝트의 app.config는 추적 구성 정보로 수정할 수 있으며, 애플리케이션이 컴파일될 때 <앱 이름>.exe.config 파일에 포함됩니다. 애플리케이션이 이미 컴파일된 <경우 이 정보를 사용하여 앱 이름>.exe.config 파일을 직접 수정할 수 있습니다.

    BizTalk 내에서 BAHA(호스트 애플리케이션용 BizTalk 어댑터)를 사용하는 경우 수정해야 하는 구성 파일은 BizTalk 애플리케이션 내의 BAHA 포트에 대해 선택된 BizTalk 호스트에 대한 BizTalk Server exe 구성 파일입니다. 구성 파일은 %BTSINSTALLPATH% 있으며 BAHA 포트에서 사용하는 32비트 또는 64비트 호스트 프로세스인지에 따라 BTSNTSvc.exe.config 또는 BTSNTSvc64.exe.config 이름이 있습니다.

    HIP(호스트 시작 처리)를 사용하는 경우 수정해야 하는 HIPService.exe.config 파일입니다. 이 파일은 %SNAROOT%있습니다.

    configSections 요소 내에 다음 섹션 문을 추가합니다. configSections 요소가 없는 경우 추가

    <configSections> 문은 <구성> 직후이며 <시작> 섹션 앞에 있어야 합니다.

    HIS 2016의 경우 configSections 요소 내에 다음 줄을 입력합니다.

    <configSections>
       <section name="hostIntegration.tracing" type="Microsoft.HostIntegration.ConfigurationSectionHandlers.Tracing.TracingConfigurationSectionHandler, Microsoft.HostIntegration.ConfigurationSectionHandlers, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    

    HIS 2013의 경우 configSections 요소 내에 다음 줄을 입력합니다(차이점은 버전 변경).

    <configSections>
       <section name="hostIntegration.tracing" type="Microsoft.HostIntegration.ConfigurationSectionHandlers.Tracing.TracingConfigurationSectionHandler, Microsoft.HostIntegration.ConfigurationSectionHandlers, Version=9.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    

    구성 섹션 끝 부분의 </configuration> 섹션을 닫기 문 바로 앞에 다음의 기본 추적 구성 요소를 추가합니다.

    <hostIntegration.tracing xmlns="http://schemas.microsoft.com/HIS/Tracing/2020">
          <traceOptions traceDefinitionFile="C:\Tracing\TI_Trace.hitd"
                        writeTraceFile="true"
                        fileNamePreamble="TI_Tracing"
                        traceFileFolder="C:\Tracing\" />
          </hostIntegration.tracing>
    
  8. 애플리케이션을 실행하여 추적을 시작합니다. 애플리케이션 구성 파일을 변경한 경우 추적을 사용하도록 설정하려면 TI 런타임에서 사용하는 프로세스를 다시 시작해야 합니다. BizTalk를 사용하는 경우 호스트 인스턴스를 다시 시작해야 합니다. IIS를 사용하는 경우 웹 사이트를 다시 시작해야 합니다. .Net exe를 실행하는 경우 해당 프로그램을 다시 시작해야 합니다.

    • C:\Tracing 폴더에서 하나 이상의 HITF(호스트 통합 추적 파일) 파일을 확인합니다. 파일의 이름은 TI_Tracing_<프로세스 ID 번호>_<날짜 및 시간>.hitf입니다. 다음은 그 예입니다.

      TI_TRACING_6076_AUG_29_2017_13_00_52_421.HITF

    • HITF 파일을 두 번 클릭하여 추적 뷰어에서 열고 추적된 내용을 검사합니다. TI 프로세스가 여전히 일부 추적 정보를 버퍼에 실행 중인 경우 애플리케이션을 종료하거나 애플리케이션 내에서 다른 TI 호출을 실행하면 버퍼가 플러시되어 첫 번째 TI 호출의 전체 추적을 볼 수 있습니다.

          TBGen invoke entered for Class: BankingCicsElmLink.Accounts
          Non-Persistent
          Attempting to acquire library reader and load HIS object assembly
          Method: GetBalance
          Using configured RE for this object
          Remote Environment: ELM Link RE
          Aggregate Converter: Microsoft.HostIntegration.TI.AggregateConverter, Microsoft.HostIntegration.TI.AggregateConverter, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
          Primitive Converter: Microsoft.HostIntegration.Common.BasePrimitiveConverter, Microsoft.HostIntegration.Common.BasePrimitiveConverter, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
          Transport: Microsoft.HostIntegration.TI.ELMTransport, Microsoft.HostIntegration.TI.ELMTransport, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
          State Machine: Microsoft.HostIntegration.TI.GenericLinkStateMachine, Microsoft.HostIntegration.TI.GenericLinkStateMachine, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
          Invoking the state machine
          Generic Link state machine entered for method: GetBalance
          ELM Transport Initialized, Link: True, Codepage: 37
          Header length: 35
          Header Length: 35, Trailer Length: 0
          Non-Persistent
      
  9. 추적 끄기

    • 추적 뷰어에서 TI_Trace.hitd 파일을 열고 추적 수준을 제거합니다. 적중된 파일이 저장되면 추적이 동적으로 꺼집니다. TI 애플리케이션을 다시 시작할 필요가 없습니다.

다양한 시나리오에 대한 샘플 애플리케이션 구성 파일

  • .Net WIP 애플리케이션 프로그램 샘플
      <?xml version="1.0"?>
      <configuration>
        <configSections>
          <section name="hostIntegration.ti.wip" type="Microsoft.HostIntegration.ConfigurationSectionHandlers.Ti.Wip.WipConfigurationSectionHandler, Microsoft.HostIntegration.ConfigurationSectionHandlers, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          <section name="hostIntegration.tracing" type="Microsoft.HostIntegration.ConfigurationSectionHandlers.Tracing.TracingConfigurationSectionHandler, Microsoft.HostIntegration.ConfigurationSectionHandlers, Version=10.0.1000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </configSections>

        <hostIntegration.ti.wip xmlns="http://schemas.microsoft.com/his/Config/TiWip/2020">
          <readOrder appConfig="first" cache="unused" registry="unused"/>
          <remoteEnvironments>
            <remoteEnvironment isDefault="true" name="ELM Link RE" timeout="5" codePage="37">
              <elmLink ipAddress="localhost" ports="7511" requestHeaderFormat="Microsoft"/>
            </remoteEnvironment>
          </remoteEnvironments>
        </hostIntegration.ti.wip>

        <startup>
          <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
        </startup>

        <hostIntegration.tracing xmlns="http://schemas.microsoft.com/his/Tracing/2020">
          <traceOptions traceDefinitionFile="C:\Tracing\TI_Trace.hitd"
                        writeTraceFile="true"
                        fileNamePreamble="TI_Tracing"
                        traceFileFolder="C:\Tracing\" />
        </hostIntegration.tracing>
      </configuration>
  • 호스트 애플리케이션용 BizTalk 어댑터를 사용하는 BizTalk 애플리케이션 샘플 - %BTSINSTALLPATH%\BTSNTSvc.exe.config or %BTSINSTALLPATH%\BTSNTSvc64.exe.config 파일:
    Here is my text
    
  • TI 런타임을 사용하는 IIS 애플리케이션에 대한 샘플
    Here is my text
    
  • HIP(TI 호스트 시작 처리) 애플리케이션에 대한 샘플 - %SNAROOT%\HIPService.exe.config 파일:
    Here is my text
    

또한 참조하십시오

SNA 추적 유틸리티 - TI 개체가 호스트 통합 서버 게이트웨이를 통해 APPC를 사용하는 경우 SNA 추적 유틸리티가 도움이 될 수 있습니다. 이 유틸리티는 호스트로부터 그리고 호스트로의 APPC 트래픽을 캡처합니다. TI 개체가 호스트 시스템과 TCP/IP를 통해 직접 통신하는 경우 이 유틸리티는 도움이 되지 않습니다.