automation-suite
2024.10
true
UiPath logo, featuring letters U and I in white
EKS/AKS の Automation Suite のインストール ガイド
Last updated 2024年11月11日

NLog を構成する

NLog 拡張機能を追加する

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

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

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

To make the extension available for use, it must uploaded to the cluster storage. The uipathctl command line tool can do this via the uipathctl config orchestrator upload command:
uipathctl config orchestrator upload --nlog-extensions-directory /path/to/extensions/directoryuipathctl config orchestrator upload --nlog-extensions-directory /path/to/extensions/directory
外部ストレージ構成をクラスター レベルで使用する場合は、それを示すために --is-external-storage パラメーターを含める必要があります。

NLog の高度な設定

Creating the advanced NLog configuration

  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. Apply the nlog.config.json file using the uipathctl command line tool:
    uipathctl config orchestrator update-config --nlog-config nlog.custom.jsonuipathctl config orchestrator update-config --nlog-config nlog.custom.json
    Important: This action overwrites the existing custom NLog configuration. You can check what the existing configuration is by using this command:
    uipathctl config orchestrator get-config --nlog-configuipathctl 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": "BufferingWrapper",
                    "flushTimeout": 5000,
                    "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": "",
                        "proxyUser": "",
                        "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": "BufferingWrapper",
                    "flushTimeout": 5000,
                    "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": "",
                        "proxyUser": "",
                        "proxyPassword": ""
                    }
                }
            },
            "rules": {
                "20_Robot_Primary": { "writeTo": "Splunk,database,insightsRobotLogs" }
            }
        }
    }

Updating the advanced NLog configuration

The uipathctl commands needed for updating the NLog configuration are:
  • uipathctl config orchestrator get-config --nlog-config- This exports the current configuration in a key-value pair json file, ready for editing.

    You can read more about it .

  • uipathctl config orchestrator update-config --nlog-config nlog.config.json - This updates the configuration with your changes.

    You can read more about it .

  1. Export the current custom NLog configuration to a json file using this command:
    uipathctl config orchestrator get-config --nlog-config > nlog.config.jsonuipathctl config orchestrator get-config --nlog-config > nlog.config.json
  2. Edit the exported nlog.config.json file as needed. You can add, remove, or change any of its settings.
    Note: You must export the file again every time you need to make a change, since the update overwrites all NLog settings.
  3. Update the NLog configuration using this command:
    uipathctl config orchestrator update-config --nlog-config nlog.config.json
    orchestrator config updateduipathctl config orchestrator update-config --nlog-config nlog.config.json
    orchestrator config updated
  • NLog 拡張機能を追加する
  • NLog の高度な設定
  • Creating the advanced NLog configuration
  • Updating the advanced NLog configuration

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

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
Uipath Logo White
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.