Troubleshooting

Logging

2Ring Power Tool logs can be found in Event Viewer -> Windows Logs -> Application under the .NET Runtime source. By default, only application errors and warnings are being logged, however, when troubleshooting, debug logs may be required. In order to enable logging of debug messages into the Event Viewer, it is needed to add the following to the Logging configuration in the appsettings.json file located in the installation directory (usually C:/Program Files/2Ring/2Ring Power Tool):

"EventLog": {
    "LogLevel": {
        "Default": "Debug"
    }
}
"Logging": {
    "LogLevel": {
        "Default": "Information",
        "Microsoft": ``"Warning"``,
        "Microsoft.Hosting.Lifetime": "Information"
    },
    "Debug": {
        "LogLevel": {
        "Default": "Debug",
        "Microsoft.Hosting": "Trace"
        }
    },
    "Console": {
        "IncludeScopes": true,
        "LogLevel": {
        "Default": "Debug"
        }
    },
    "EventLog": {
        "LogLevel": {
        "Default": "Debug"
        }
    }
}

In order to disable logging of debug messages, change Logging.EventLog.LogLevel.Default to Warning.

Example of the Logging configuration:

"Logging": {
    "LogLevel": {
        "Default": "Information",
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
    },
    "Debug": {
        "LogLevel": {
        "Default": "Debug",
        "Microsoft.Hosting": "Trace"
        }
    },
    "Console": {
        "IncludeScopes": true,
        "LogLevel": {
        "Default": "Debug"
        }
    },
    "EventLog": {
        "LogLevel": {
        "Default": "Warning"
        }
    }
}

Any modification made to the Logging configuration is applied immediately without the need for application restart.

Debug logs should only be enabled when actively troubleshooting the application.