UiPath Documentation
automation-suite
2.2510
true
EKS/AKS の Automation Suite のインストール ガイド
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

NLog を構成する

EKS/AKS の Automation Suite の Orchestrator の NLog ログを設定します。

NLog 拡張機能を追加する​

以下の拡張機能が Orchestrator によって既定で読み込まれるため、フォルダーまたは NLog の構成にこれらの拡張機能を含める必要はありません。

  • NLog.Targets.ElasticSearch
  • UiPath.Orchestrator.Logs.Elasticsearch
  • Microsoft.ApplicationInsights.NLogTarget
  • NLog.Extensions.AzureEventHub

この設定で使用できるのは Linux 対応の拡張機能のみであるため、選択した NLog 拡張機能がこのルールに準拠していることを確認してください。

拡張機能を使用できるようにするには、クラスター ストレージに拡張機能をアップロードする必要があります。uipathctl コマンド ライン ツールでは、uipathctl config orchestrator upload コマンドを使用してこれを行うことができます。

uipathctl config orchestrator upload --nlog-extensions-directory /path/to/extensions/directory
uipathctl config orchestrator upload --nlog-extensions-directory /path/to/extensions/directory

外部ストレージ構成をクラスター レベルで使用する場合は、それを示すために --is-external-storage パラメーターを含める必要があります。

NLog の高度な設定​

NLog の高度な構成を作成する​

  1. 拡張機能、ターゲット、ルールといった標準的なセクションを含む nlog.config.json ファイルを作成します。

    拡張機能セクションは、assemblyFile を使用して拡張機能アセンブリを指定する項目の配列と、アセンブリのパスです。

    If custom NLog plugins were loaded (as described in the Adding NLog extensions section), they will be referenced in the extensions section.

  2. nlog.config.json ファイルでターゲットとルールを構成します。

  3. uipathctl コマンド ライン ツールを使用して、nlog.config.json ファイルを適用します。

    uipathctl config orchestrator update-config --nlog-config nlog.config.json
    uipathctl config orchestrator update-config --nlog-config nlog.config.json
    
    重要:

    この操作を行うと、既存のカスタム NLog 構成が上書きされます。既存の設定を確認するには、次のコマンドを使用します。

    uipathctl config orchestrator get-config --nlog-config
    uipathctl config orchestrator get-config --nlog-config
    

    Azure BLOB にログを書き込む nlog.config.json ファイルの例

    {   "NLog": {
            "extensions": [
                { "assemblyFile": "NLog.Extensions.AzureBlobStorage.dll" }
            ],
            "targets": {
                "azureBlob": {
                    "type": "AzureBlobStorage",
                    "connectionString": "DefaultEndpointsProtocol=https;AccountName=test;AccountKey=key;EndpointSuffix=core.windows.net",
                    "container": "orchestratorlogs",
                    "blobName": "${date:format=yyyy-MM-dd hh.mm}",
                    "layout": {
                      "type": "JsonLayout",
                      "includeAllProperties": true,
                      "Attributes": [
                        {"name": "ts","layout": "${longdate}"},
                        {"name": "level","layout": "${level:upperCase=true}"},
                        {"name": "logger","layout": "${logger}"},
                        {"name": "message","layout": "${message}"},
                        {"name": "exception","layout": "${onexception:${ui-pretty-exception}}"}
                      ]
                    }
                }
            },
            "rules": { "70_Final": { "writeTo": "stdout,azureBlob" } }
        }
    }
    {   "NLog": {
            "extensions": [
                { "assemblyFile": "NLog.Extensions.AzureBlobStorage.dll" }
            ],
            "targets": {
                "azureBlob": {
                    "type": "AzureBlobStorage",
                    "connectionString": "DefaultEndpointsProtocol=https;AccountName=test;AccountKey=key;EndpointSuffix=core.windows.net",
                    "container": "orchestratorlogs",
                    "blobName": "${date:format=yyyy-MM-dd hh.mm}",
                    "layout": {
                      "type": "JsonLayout",
                      "includeAllProperties": true,
                      "Attributes": [
                        {"name": "ts","layout": "${longdate}"},
                        {"name": "level","layout": "${level:upperCase=true}"},
                        {"name": "logger","layout": "${logger}"},
                        {"name": "message","layout": "${message}"},
                        {"name": "exception","layout": "${onexception:${ui-pretty-exception}}"}
                      ]
                    }
                }
            },
            "rules": { "70_Final": { "writeTo": "stdout,azureBlob" } }
        }
    }
    

    Splunk にロボット ログを書き込む nlog.config.json ファイルの例を以下に示します。

    {
        "Nlog": {
            "extensions": [
                { "assemblyFile": "NLog.Targets.Splunk.dll" },
                { "assembly": "UiPath.Orchestrator.Logs.DatabaseBulk.NLogTarget" }
            ],
            "targets": {
                "Splunk": {
                    "type": "AsyncWrapper",
                    "overflowAction": "Discard",
                    "queueLimit": 10000,
                    "batchSize": 200,
                    "timeToSleepBetweenBatches": 1,
                    "target": {
                        "type": "SplunkHttpEventCollector",
                        "serverUrl": "http://splunk.example.com",
                        "token": "splunk-token",
                        "channel": "",
                        "source": "${logger}",
                        "sourceType": "_json",
                        "index": "uipath",
                        "retriesOnError": "0",
                        "batchSizeBytes": "0",
                        "batchSizeCount": "0",
                        "includeEventProperties": "true",
                        "includePositionalParameters": "true",
                        "includeMdlc": "true",
                        "maxConnectionsPerServer": "10",
                        "ignoreSslErrors": "false",
                        "useProxy": "false",
                        "proxyUrl": "",
                        "proxyPassword": ""
                    }
                }
            },
            "rules": {
                "20_Robot_Primary": { "writeTo": "Splunk,database,insightsRobotLogs" }
            }
        }
    }
    {
        "Nlog": {
            "extensions": [
                { "assemblyFile": "NLog.Targets.Splunk.dll" },
                { "assembly": "UiPath.Orchestrator.Logs.DatabaseBulk.NLogTarget" }
            ],
            "targets": {
                "Splunk": {
                    "type": "AsyncWrapper",
                    "overflowAction": "Discard",
                    "queueLimit": 10000,
                    "batchSize": 200,
                    "timeToSleepBetweenBatches": 1,
                    "target": {
                        "type": "SplunkHttpEventCollector",
                        "serverUrl": "http://splunk.example.com",
                        "token": "splunk-token",
                        "channel": "",
                        "source": "${logger}",
                        "sourceType": "_json",
                        "index": "uipath",
                        "retriesOnError": "0",
                        "batchSizeBytes": "0",
                        "batchSizeCount": "0",
                        "includeEventProperties": "true",
                        "includePositionalParameters": "true",
                        "includeMdlc": "true",
                        "maxConnectionsPerServer": "10",
                        "ignoreSslErrors": "false",
                        "useProxy": "false",
                        "proxyUrl": "",
                        "proxyPassword": ""
                    }
                }
            },
            "rules": {
                "20_Robot_Primary": { "writeTo": "Splunk,database,insightsRobotLogs" }
            }
        }
    }
    

Splunk queueLimit​のサイズ設定

このキューは、低速時に Splunk のバックログを吸収します。平均ではなく、ピークスループットに合わせてサイズを設定します。

queueLimit = peak_logs_per_sec × acceptable_backlog_seconds
queueLimit = peak_logs_per_sec × acceptable_backlog_seconds
デプロイピーク レートバックログの許容度queueLimit
小~10 ログ/秒60秒600
中~35ログ/秒300秒10000
大~200ログ/秒60秒12000

Splunk ターゲットのベスト プラクティス​

  • セカンダリ ターゲットには overflowAction: Discard を使用します。Splunk などの外部ログ ターゲットは通常、分析またはオブザーバビリティの宛先であり、Orchestrator データベースは信頼できる情報源です。外部ターゲットが追いつかない場合は、アプリケーションスレッドをブロックするよりも、そのコピーをドロップすることをお勧めします。
  • 損失が受け入れられないターゲットのために overflowAction: Block を予約します。Block はイベントの損失を防ぎますが、ブロックを防ぐことはできません。持続的な負荷でキューがいっぱいになると、キューは BufferingWrapperと同じスレッド ブロック動作に戻ります。外部ターゲットがコンプライアンス要件または監査要件であり、ピーク スループットに合わせてサイズ queueLimit 余裕がある場合にのみ使用してください。
  • writeToルールには必ず外部ターゲットと一緒にdatabaseしてください。これにより、外部ターゲットの可用性やパフォーマンスに関係なく、ロボット ログが完全に失われることはありません。
  • シャットダウン前にフラッシュします。AsyncWrapper はイベントをメモリ内のキューに保持します。プロセスの終了時にキューの末尾が失われることがないように、正常シャットダウン時に NLog ターゲットがフラッシュされるようにします。

NLog の高度な構成を更新する​

NLog の構成を更新するために必要な uipathctl コマンドは、次のとおりです。

  • uipathctl config orchestrator get-config --nlog-config - 現在の設定をキーと値のペアの json ファイルにエクスポートし、編集できるようにします。
  • uipathctl config orchestrator update-config --nlog-config nlog.config.json - 変更内容を使用して設定を更新します。
  1. 次のコマンドを使用して、現在のカスタム NLog 構成を json ファイルにエクスポートします。

    uipathctl config orchestrator get-config --nlog-config > nlog.config.json
    uipathctl config orchestrator get-config --nlog-config > nlog.config.json
    
  2. エクスポートした nlog.config.json ファイルを必要に応じて編集します。 設定を追加、削除、または変更できます。

    注:

    変更が必要になるたびにファイルを再度エクスポートする必要があります。更新によって NLog の設定がすべて上書きされるためです。

  3. 次のコマンドを使用して NLog 構成を更新します。

    uipathctl config orchestrator update-config --nlog-config nlog.config.json
    orchestrator config updated
    uipathctl config orchestrator update-config --nlog-config nlog.config.json
    orchestrator config updated
    

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得