{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":41088,"path":"platform-security/edge-encryption/edge-debug-logging.md","title":"Increase debug logging for the Edge Encryption proxy","bundle":null,"doc_type":null,"release":"australia","body":"\n# Increase debug logging for the Edge Encryption proxy\n\nIncrease the level of logging to interpret the logs and debug issues with the proxy.\n\nThere are currently three options for increasing debug logging in the Edge Encryption proxy. Increase the level of logging to debug issues provide technical support with information to look into the issue with the benefit of more verbose log statements.\n\nDepending on the issue being debugged, set up debug logging in one of three ways:\n\n-   Debugging issues other than SSL connectivity\n-   Logging timing metrics for requests through the proxy\n-   Debugging issues with SSL connectivity between the Edge Encryption Proxy and the instance\n\nFor all debug cases, you may view and interpret the logs in your own or open an incident to get an interpretation from ServiceNow technical support providing the description of the issue and how it’s reproduced.\n\n**Parent Topic:**[Configuring Edge Encryption](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/platform-security/edge-encryption/edge-config.md)\n\n## Debugging issues with the Edge Encryption application other than SSL connectivity\n\nUse this method to debug issues with the Edge Encryption application, without stopping and restarting the proxy. These steps increase logging level and help troubleshooting the root cause with more verbose log statements.\n\n### Before you begin\n\nRole required: admin\n\n**Note:** Changes made to the `$proxy_installation_location/conf/log4j2.properties` file are taken up by the proxy within about 60 seconds after you make your changes. You don’t have to restart the proxies.\n\n### Procedure\n\n1.  In the `$proxy_installation_location/conf/log4j2.properties` file find the following line.\n\n    ```\n    logger.edge.level=info\n    ```\n\n2.  Change the above line to the following:\n\n    ```\n    logger.edge.level=debug\n    ```\n\n3.  Save the change.\n\n    It may take up to 60 seconds for the change to take effect, but this doesn’t require a proxy restart.\n\n4.  Reproduce your issue.\n\n5.  Check for debug log statements related to the application in the `$proxy_installation_location/logs/edgeencryption.log` file.\n\n\n### Result\n\nAfter making the property change, you can see additional detail in your `$proxy_installation_location/logs/edgeencryption.log` file. When you have finished debugging, revert the change made to the `$proxy_installation_location/conf/log4j2.properties` file.\n\n## Logging timing metrics for requests through the proxy\n\nEnable timing metric logging to add a metric statement for each request handled by the Edge Encryption proxy. Each of these timing metric log statements contains useful information about the request, such as processing times and which encryption rule was used.\n\n### Before you begin\n\nRole required: admin\n\n**Note:**\n\nThe additional logging settings are added to the `$proxy_installation_location/conf/log4j2.properties` file. Changes made are taken up by the proxy dynamically within about a minute after the changes to the file are made, so you do not have to restart the proxies.\n\n### Procedure\n\n1.  Modify the `$proxy_installation_location/conf/log4j2.properties` file by adding the following lines at the end of the file\n\n    ```\n    appender.timinglog.type=RollingFile\n    appender.timinglog.name=TimingLog\n    appender.timinglog.fileName=../logs/edgenetwork.log\n    appender.timinglog.filePattern=../logs/$${date:yyyy-MM}/edgenetwork-%d{yyyy-MM-dd-HH}-%i.log.gz\n    appender.timinglog.layout.type=PatternLayout\n    appender.timinglog.layout.pattern=%d [%t] %-5p %m%n\n    appender.timinglog.policies.type=Policies\n    appender.timinglog.policies.size.type=SizeBasedTriggeringPolicy\n    appender.timinglog.policies.size.size=500MB\n    appender.timinglog.strategy.type=DefaultRolloverStrategy\n    appender.timinglog.strategy.max=4\n    \n    logger.timing.name=com.snc.edgeencryption.metrics.EdgeEncryptionTimingMetricCache\n    logger.timing.level=debug\n    logger.timing.additivity=false\n    logger.timing.appenderRef.rolling.ref=TimingLog\n    ```\n\n2.  Save the file.\n\n\n### Result\n\nAfter the `log4j.properties` file is saved, the following types of messages appear in the `$proxy_installation_location/logs/edgenetwork.log` log file for network times.\n\n```\n2022-07-21 12:56:15,783 [qtp1971991758-7700] DEBUG com.snc.edgeencryption.metrics.EdgeEncryptionTimingMetricCache -  request_uri=/api/now/ui/presencesysparm_auto_request=true&cd=1658433375754 request_method=POST client_request_received=\"2022-07-21 12:56:15,015\" proxy_request_processing_time=6 all_rules_processing_time=0 rule_executed=\"REST JSON\" rule_execution_time=1 proxy_instance_round_trip=14 proxy_response_processing_time=1 total_time_from_proxy=21 reponse_code=201 glide_user=SCv3_1:BAz1ZK7ee9XoroG2nvMlixHpgTvsT4fY2bwQvnH2WdU=:y5HGsTTqo3Pjq6G0xk4LoazCwCiWRJk4/6SpbXuBzqg=:6816f79cc0a8016401c5a33be04be441 jsessionid_suffix=037A66\n\n```\n\nThe values in the log messages are as follows:\n\n```\nrequest_uri: The URI being requested\n\nrequest_method: The HTTP method being used, for example, GET, POST, PUT, PATCH, DELETE\n\nclient_request_received: The timestamp noting when the HTTP client request arrived at the Edge proxy\n\nproxy_request_processing_time: How long the Edge proxy took to process the request in milliseconds\n\nall_rules_processing_time: Total time it took to execute all of the Edge Encryption rules for the request in milliseconds\n\nrule_executed: The name of the encryption rule that was executed\n\nrule_execution_time: How long it took to execute listed rule_executed in milliseconds\n\nproxy_instance_round_trip: The time from when the Edge proxy sent the request to the instance until the instance sent the response and was received by the edge proxy in milliseconds\n\nproxy_response_processing_time: How long the Edge proxy took to process the response in milliseconds\n\ntotal_time_from_proxy: The total time from when the Edge proxy received the request from the client and returned the response to the client in milliseconds\n\nresponse_code: HTTP response code \n\nglide_user: The glide_user cookie value\n\njsessionid_suffix: The JSession cookie suffix associated with the request\n```\n\n## Debug issues with SSL connectivity between the Edge Encryption proxy and the instance\n\nUse this method to debug issues with SSL connectivity between the Edge Encryption proxy and your instance, such as access to the instance fails via the proxy. These steps increase logging and help find the verbose log statements.\n\n### Before you begin\n\nRole required: admin\n\n**Note:** SSL connectivity debugging is only relevant when troubleshooting TLS connectivity type issues. In practice, this is not common and rarely needed.\n\n### Procedure\n\n1.  Stop the proxy server.\n\n2.  Add the following line to the file `$proxy_installation_location/conf/wrapper.conf`, which is a Java startup property:\n\n    ```\n    wrapper.java.additional.<next available number in sequence> = -Djavax.net.debug=all\n    \n    ```\n\n    For example:\n\n    ```\n    For example: wrapper.java.additional.4 = -Djavax.net.debug=all\n    ```\n\n3.  Save the change and restart the proxy server.\n\n4.  Reproduce your connectivity issue.\n\n\n### Result\n\nAfter reproducing the issue debug log statements related to the SSL exchange can be found in the`$proxy_installation_location/logs/wrapper_<current date>.log` file. When you are finished debugging. You can remote the additional logging by removing or commenting out the line created in the previous steps.\n\n"}}