- スタート アップ ガイド
- ベスト プラクティス
- テナント
- リソース カタログ サービス
- フォルダー コンテキスト
- 自動化
- プロセス
- ジョブ
- トリガー
- ログ
- ログについて
- Orchestrator でログを管理する
- ログ レベル
- Orchestrator のログ
- 監視
- キュー
- アセット
- ストレージ バケット
- Orchestrator のテスト
- その他の構成
- Integrations
- クラシック ロボット
- ホストの管理
- 組織管理者
- トラブルシューティング
Orchestrator 診断ログ
これらは、UiPath Orchestrator で生成された、その動作に関する診断ログです。
UiPath Orchestrator 診断ログの有効化
UiPath Orchestrator 診断ログは、UiPath Orchestrator が正常にインストールされると有効化されます。この診断ログは NLog インフラストラクチャーに依存し、その構成は UiPath.Orchestrator.dll.config ファイルの <nlog> タグ下で確認することができます。
ユーザーがどの言語を選択したかに関わらず、Orchestrator とスタック トレースからのサーバー例外は両方とも [ジョブの詳細] ウィンドウに英語で表示されます。
UiPath Orchestrator 診断ログのターゲット
すべてのアプリケーション ログは、[Information] という最小のログ レベルでイベント ビューアーに記録されます。これは、UiPath.Orchestrator.dll.config ファイル内の次の行で指定します。
<target xsi:type="EventLog" name="eventLog" layout="${message}" source="Orchestrator" log="Application" />
<logger name="*" minlevel="Info" writeTo="eventLog" />
ジョブ スケジューラにより生成されたログには、別のターゲットとロガーが含まれています。
<target xsi:type="EventLog" name="eventLogQuartz" layout="[Quartz] ${message} ${onexception: ${exception:format=tostring}}" source="Orchestrator" log="Application" />
<logger name="Orchestrator.Quartz.*" minlevel="Info" writeTo="eventLogQuartz" />
例:
Could not create Quartz Job
ビジネスおよびその他の検証ルールにより生成されたログには、別のターゲットとロガーが含まれています。
<target xsi:type="EventLog" name="businessExceptionEventLog" layout="${message}${onexception:${exception:format=tostring:maxInnerExceptionLevel=5:innerFormat=tostring}}" source="Orchestrator.BusinessException" log="Application" />
<logger name="BusinessException.*" minlevel="Info" writeTo="businessExceptionEventLog" final="true" />
これらの種類のエラー メッセージは、次のような場合にイベント ビューアーに記録されます。
- 検証に関する問題:
Invalid username/email address or password.The machine name DOC is already taken
- ビジネスコンフリクト:
License expired!The floating robot's session is already active on machine ROQADOCS06!The robots already have pending jobs for this Process.
- NotFound 例外:
QueueName1 does not exist.
Orchestrator 実行ログ
The Orchestrator Execution Logs are sent by the Robots connected to it and are displayed in the Logs section of the Jobs or Robots pages. The application receives the data from the Robots, adds its own parameters (TenantID, FolderID), and forwards the messages to different targets, as specified in the <nlog> section from the UiPath.Orchestrator.dll.config file.
Orchestrator 実行ログの対象
既定では、ロボットのすべてのログは既定の Orchestrator データベースの [ログ] 表に送信されます。ここには UiPath Orchestrator の他の情報も保存されます。
ただし、ロボット ログを別のデータベースに送信することもできます。その場合は、UiPath.Orchestrator.dll.config ファイルの target xsi:type="Database" connectionString="..." セクションでデータベースを構成します。
[ログ] ページには、既定データベースの [ログ] 表からの情報が表示されます。したがって、このセクションが存在しない場合、またはログが別のデータベースに保存されている場合は、ページは空となります。すべてのパラメーターは、次のようにテーブル スキーマに準拠している必要があります。
<target xsi:type="Database" name="database" connectionString="${ui-connection-strings:item=Default}" keepConnection="true">
<commandText>
insert into dbo.Logs (OrganizationUnitId, TenantId, TimeStamp, Level, WindowsIdentity, ProcessName, JobKey, Message, RawMessage)
values (@organizationUnitId, @tenantId, @timeStamp, @level, @windowsIdentity, @processName, @jobId, @message, @rawMessage)
</commandText>
<parameter name="@organizationUnitId" layout="${event-properties:item=organizationUnitId}" />
<parameter name="@tenantId" layout="${event-properties:item=tenantId}" />
<parameter name="@timeStamp" layout="${date}" />
<parameter name="@level" layout="${event-properties:item=levelOrdinal}" />
<parameter name="@windowsIdentity" layout="${event-properties:item=windowsIdentity}" />
<parameter name="@processName" layout="${event-properties:item=processName}" />
<parameter name="@jobId" layout="${event-properties:item=jobId}" />
<parameter name="@message" layout="${message}" />
<parameter name="@rawMessage" layout="${event-properties:item=rawMessage}" />
</target>
<logger name="Robot.*" writeTo="database" final="true" />
<target xsi:type="Database" name="database" connectionString="${ui-connection-strings:item=Default}" keepConnection="true">
<commandText>
insert into dbo.Logs (OrganizationUnitId, TenantId, TimeStamp, Level, WindowsIdentity, ProcessName, JobKey, Message, RawMessage)
values (@organizationUnitId, @tenantId, @timeStamp, @level, @windowsIdentity, @processName, @jobId, @message, @rawMessage)
</commandText>
<parameter name="@organizationUnitId" layout="${event-properties:item=organizationUnitId}" />
<parameter name="@tenantId" layout="${event-properties:item=tenantId}" />
<parameter name="@timeStamp" layout="${date}" />
<parameter name="@level" layout="${event-properties:item=levelOrdinal}" />
<parameter name="@windowsIdentity" layout="${event-properties:item=windowsIdentity}" />
<parameter name="@processName" layout="${event-properties:item=processName}" />
<parameter name="@jobId" layout="${event-properties:item=jobId}" />
<parameter name="@message" layout="${message}" />
<parameter name="@rawMessage" layout="${event-properties:item=rawMessage}" />
</target>
<logger name="Robot.*" writeTo="database" final="true" />
UiPath.Orchestrator.dll.config ファイルを設定することで、他のターゲットをログに追加できます。利用可能なターゲットのリストはこちらをご覧ください。
テーブルに保存されるロボット ログの数が 100 万を超える場合は、検索パフォーマンスを向上させるために次のインデックスを作成することをお勧めします。
CREATE NONCLUSTERED INDEX [IX_Search] ON [dbo].[Logs]
(
[TenantId] ASC,
[OrganizationUnitId] ASC,
[Level] ASC,
[TimeStamp] DESC
)WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_Search] ON [dbo].[Logs]
(
[TenantId] ASC,
[OrganizationUnitId] ASC,
[Level] ASC,
[TimeStamp] DESC
)WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
Elasticsearch サーバー
既定では、インストール スクリプトから構成された Elasticsearch ターゲットが存在します。インデックスはテナントごとに異なりますが、<nlog> セクションで指定されたターゲットから構成できます。
Elasticsearch バージョン 8.0 未満の場合:
<target name="robotElasticBuffer" xsi:type="BufferingWrapper" flushTimeout="5000">
<target xsi:type="ElasticSearch" name="robotElastic" uri="uritoelasticsearchnode" index="${event-properties:item=indexName}-${date:format=yyyy.MM}" documentType="logEvent" includeAllProperties="true" layout="${message}" excludedProperties="agentSessionId,tenantId,organizationId,indexName" />
</target>
</target>
<target name="robotElasticBuffer" xsi:type="BufferingWrapper" flushTimeout="5000">
<target xsi:type="ElasticSearch" name="robotElastic" uri="uritoelasticsearchnode" index="${event-properties:item=indexName}-${date:format=yyyy.MM}" documentType="logEvent" includeAllProperties="true" layout="${message}" excludedProperties="agentSessionId,tenantId,organizationId,indexName" />
</target>
</target>
Elasticsearch バージョン 8.0 以上の場合:
<target name="robotElasticBuffer" xsi:type="BufferingWrapper" flushTimeout="5000">
<target xsi:type="ElasticSearch" name="robotElastic" uri="uritoelasticsearchnode" index="${event-properties:item=indexName}-${date:format=yyyy.MM}" documentType="" includeAllProperties="true" layout="${message}" excludedProperties="agentSessionId,tenantId,organizationId,indexName" />
</target>
</target>
<target name="robotElasticBuffer" xsi:type="BufferingWrapper" flushTimeout="5000">
<target xsi:type="ElasticSearch" name="robotElastic" uri="uritoelasticsearchnode" index="${event-properties:item=indexName}-${date:format=yyyy.MM}" documentType="" includeAllProperties="true" layout="${message}" excludedProperties="agentSessionId,tenantId,organizationId,indexName" />
</target>
</target>
バージョン 8.0 以降の Elasticsearch が正常に機能するために、これらのパラメーターは次のように設定されます。
documentTypeは空です。enableApiVersioningHeaderはtrueに設定されます。
バージョン 7.16.3 未満の Elasticsearch
Elasticsearch バージョン 7.16.3 が推奨されますが、それよりも前のバージョンを使用するには、Nlog ターゲット (<target xsi:type="ElasticSearch") で disableProductCheckStatus パラメーターを true に設定します。
このパラメーターは非表示で、既定値は false です。
ロボット ログを Elasticsearch サーバーに保存するオプションは、オプションを構成した後にのみ有効となり、過去にさかのぼっては適用されません。つまり、オプションの構成時にデータベースにすでに存在していたログにはアクセスできなくなります。ログを取得および表示できるのは 1 つの保存先のみからであるためです。
X-PACK 認証
Basic またはトライアル ライセンスの場合、Elasticsearch のセキュリティ機能は既定で無効化されています。この機能を有効化することを強くお勧めします。
ユーザー名とパスワードによる認証
ユーザー名とパスワードによる認証を有効化するには、以下の手順を実行する必要があります。
-
Elasticsearch サーバーを以下のように設定します。
-
elasticsearch.yml設定ファイルにxpack.security.enabledの設定を追加します。 -
ユーザー名とパスワードを設定します。
詳細については、Elasticsearch のドキュメントをご覧ください。
-
-
Orchestrator の
UiPath.Orchestrator.dll.configファイルを以下のように設定します。
-
オプション 1: NLog ターゲットを使用しない場合は、パラメーター
Logs.Elasticsearch.UsernameとLogs.Elasticsearch.Passwordを設定する必要があります。これらの値が、手順 1 の Elasticsearch の設定に一致していることを確認してください。 -
オプション 2:
Logs.RobotLogs.ReadTargetが NLog のターゲットに設定されていて (例:robotElasticBuffer)、Logs.Elasticsearch.Nodesの設定が指定されていない場合は、requireAuth="true" username="XPACKuser" password="p@$$w0rd"を追加してターゲットを設定します。これらのパラメーター値が、手順 1 の Elasticsearch の設定と一致していることを確認してください。以下に設定例を示します。
<target name="robotElasticBuffer" xsi:type="BufferingWrapper" flushTimeout="5000"> <target xsi:type="ElasticSearch" name="robotElastic" uri="" requireAuth="true" username="XPACKusername" password="p@$$w0rd" index="${event-properties:item=indexName}-${date:format=yyyy.MM}" documentType="logEvent" includeAllProperties="true" layout="${message}" excludedProperties="agentSessionId,tenantId,indexName" /> </target><target name="robotElasticBuffer" xsi:type="BufferingWrapper" flushTimeout="5000"> <target xsi:type="ElasticSearch" name="robotElastic" uri="" requireAuth="true" username="XPACKusername" password="p@$$w0rd" index="${event-properties:item=indexName}-${date:format=yyyy.MM}" documentType="logEvent" includeAllProperties="true" layout="${message}" excludedProperties="agentSessionId,tenantId,indexName" /> </target> -
オプション 3:
Logs.RobotLogs.ReadTargetが NLog のターゲットに設定されていて (例:robotElasticBuffer)、Elasticsearch のノードがLogs.Elasticsearch.Nodesの設定で指定されている場合は、このノードを明示的に設定する必要があります (NLog ターゲットの設定より優先されるため)。さらに、requireAuth="true" username="XPACKuser" password="p@$$w0rd"を追加することも忘れないでください。これらのパラメーター値が、手順 1 の Elasticsearch の設定と一致していることを確認してください。
OAuth 2.0 認証
Elasticsearch の認証方法を OAuth2 に切り換えるには、以下の手順を実行する必要があります。このトークン ベースの認証方法に切り換えるには、現在の資格情報を入力する必要があることに注意してください。
-
Elasticsearch サーバーを以下のように設定します。
a. トランスポート層の TLS (HTTPS) を有効化します。
b. 設定ファイル
elasticsearch.ymlの、以下の設定を更新します。-
xpack.security.authc.token.enabled: true -
xpack.security.enabled: true -
xpack.security.authc.token.timeout- この設定は任意です。トークンの有効期間を制御します。既定の設定値は 20 分です。詳細については、Elasticsearch のドキュメントをご覧ください。
-
-
Orchestrator の
UiPath.Orchestrator.dll.configファイルにある以下のパラメーターを、手順 1 で選択した設定を反映するように変更します。-
Logs.Elasticsearch.TlsEnabled = ”true”- 既定で、このパラメーターはtrueに設定され、TLC (HTTPS) が有効化されます。 -
Logs.Elasticsearch.OAuthEnabled = ”true”- 既定で、このパラメーターはfalseに設定されます。詳しくは、「Logs.Elasticsearch.OAuthEnabled」をご覧ください。 -
Logs.Elasticsearch.OAuthExpireInSeconds = ”1200”- Elasticsearch のxpack.security.authc.token.timeoutの設定で既定値の1200が変更されていないかぎり、このパラメーターの指定は任意です。このパラメーターは、Elasticsearch の設定と同じ値である必要があります。詳しくは、「Logs.Elasticsearch.OAuthExpireInSeconds」をご覧ください。注:最初の 2 つの手順は、ログを読み取るためのトークン ベースの認証メカニズムを設定するためのものです。NLog を使用している場合は、追加の手順が必要になります。
-
-
To enable OAuth2 for Nlog, make sure to also configure the following parameter in Orchestrator's
UiPath.Orchestrator.dll.configfile. Note that you must fill in the username and password for authentication in Elasticsearch because the initial token is generated based on those credentials.-
OAuthEnabled = “true”- 既定ではfalseに設定されています。詳細については、「UiPath.Orchestrator.dll.config」のページをご覧ください。重要:Logs.RobotLogs.ReadTargetが NLog のターゲットに設定され (例:robotElasticBuffer)、Logs.Elasticsearch.Nodesが設定されていない場合、Logs.Elasticsearch.OAuthEnabledには、NLog ターゲットの設定が入力されます。ユーザー名とパスワードについても、同じロジックが適用されます。
-
API キー認証
API キーによる認証を有効化するには、以下の手順に従います。
-
こちらの手順に従って API キーを生成します。
-
API キーを Azure Key Vault にシークレットとして保存します。
-
以下の Nlog ターゲット パラメーターに実際のデータを設定します。これにより、Orchestrator と Key Vault 間に接続が作成され、キーを取得できるようになります。
apiKeyEnabled="true" apiKeyProvider="AzureKeyVault" apiKeySecretName="<SecretName>" azureKeyVaultUri="<KeyVaultUri>" azureKeyVaultDirectoryId="<KeyVaultDirectoryId>" azureKeyVaultClientId="<KeyVaultClientId>" azureKeyVaultCertificateThumbprint="<KeyVaultCertificateThumbprint>" azureKeyVaultCertificateStoreLocation="CurrentUser/LocalMachine"apiKeyEnabled="true" apiKeyProvider="AzureKeyVault" apiKeySecretName="<SecretName>" azureKeyVaultUri="<KeyVaultUri>" azureKeyVaultDirectoryId="<KeyVaultDirectoryId>" azureKeyVaultClientId="<KeyVaultClientId>" azureKeyVaultCertificateThumbprint="<KeyVaultCertificateThumbprint>" azureKeyVaultCertificateStoreLocation="CurrentUser/LocalMachine"以下のパラメーターを実際の値に編集する必要があります。
<SecretName>- Key Vault で API キーに設定した名前<KeyVaultUri>- Key Vault の URI<KeyVaultDirectoryId>- Key Vault ディレクトリ ID<KeyVaultClientId>- Key Vault のクライアント ID<KeyVaultCertificateThumbprint>- Key Vault 証明書の拇印CurrentUser/LocalMachine- 証明書が保存されている場所
API キーの有効期限
既定では、API キーに有効期限はありません。ただし、有効期限を設定することもできます。
API キーに有効期限を設定する場合は、Orchestrator が常に有効なキーを取得できるよう、有効期限の前に新しいキーを生成して Key Vault に保存する必要があります。
Orchestrator は、15 分ごとにキー コンテナーから API キーを読み取ります。したがって、15 分以内に新しいキーが反映されるようにする必要があります。