Adjusting Unity Log Levels

These instructions outline how to lower and raise the Unity log levels. Oftentimes we have log levels set high in UnityTest to help troubleshoot issues but as a general rule, we should keep them low in UnityProd as we have seen performance issues when they are set high. There are two files to adjust in the Unity file structure which are AppSettings.json and nLog.config.

Instructions

  1. To set Unity log levels to the lowest amount of logging

    1. Locate the Unity instance (typically located on servers in this location: C:\inetpub\wwwroot\UnityProd)

    2. AppSettings.json - set the two settings below to ‘Warning’ and ‘false’. Always maintain the capitalization that you see in these files. For example, if the value is set to ‘true’, change to ‘false’ not ‘False’.

      1. "LogLevel": { "Default": "Warning"
      2. "RequestTracingEnabled": false,
    3. nLog.config - set the minlevel to ‘Warn’. There are several settings in this file that look similar so it’s recommended to search for the string below.

      1. <logger name="*" minlevel="Warn" writeTo="allfile" />
  2. To set Unity log levels to the highest amount of logging

    1. Locate the Unity instance (typically located on servers in this location: C:\inetpub\wwwroot\UnityProd)

    2. AppSettings.json - set the two settings below to ‘Debug’ and ‘true’. Always maintain the capitalization that you see in these files. For example, if the value is set to ‘false’, change to ‘true’ not ‘True’.

  3. nLog.config - set the minlevel to ‘Trace’. There are several settings in this file that look similar so it’s recommended to search for the string below.

 

Depending on the level of security the logged in use has, you may need to open Notepad ‘as an administrator’ in order to save changes to these files. To do this, click the Windows Start Button and start typing in ‘Notepad'. When it appears in the search result, right-click and select ‘run as administrator’. In rare cases, we would need the customer’s IT department to make these changes.

Related articles

Filter by label

There are no items with the selected labels at this time.