See the basic setup steps below to get started with the Logify Alert service:

The following additional steps may be required, based on your application deployment strategy and logging service preferences:

Generate an API Key

The Logify Alert service uses unique identifiers – API keys – to register and monitor individual applications. You will use this key later when creating an instance of Logify Alert client in code.

  1. Log in to the Logify Alert website:

  2. Switch to the Applications tab and click Create New Application.

  3. Specify the application name and description, then click Create.

  4. The Applications tab will now display a new entry with an auto-generated API key.

Send Reports to Logify Alert

This section explains how to modify your WinForms application so that it reports unhandled exceptions to the Logify Alert service.

Add the Logify Alert Client to Your Project

Select Tools | NuGet Package Manager | Package Manager Console in the Visual Studio main menu and execute the following command.

Install-Package Logify.Alert.Win

Enable Automatic Reporting

To automatically intercept all unhandled exceptions and send corresponding crash reports to Logify Alert, add the following code before the Application.Run() method.

using DevExpress.Logify.Win; LogifyAlert client = LogifyAlert.Instance; client.ApiKey = "SPECIFY_YOUR_API_KEY_HERE"; client.StartExceptionsHandling(); // ... Application.Run(new Form_Name());

You can also set up the Logify Alert client in the App.config file which is automatically changed when you install a NuGet package containing a Logify Alert client. See Setup using a Configuration File for details.

<configuration>   <configSections>     <section name="logifyAlert" type="DevExpress.Logify.LogifyConfigSection, Logify.Alert.Win"/>   </configSections>   ...   <logifyAlert>     <apiKey value="SPECIFY_YOUR_API_KEY_HERE"/>   </logifyAlert> </configuration>

Manual Reporting

Use the following code to catch exceptions and send reports manually.

using DevExpress.Logify.Win; try {   // Some code } catch (Exception ex){   LogifyAlert client = LogifyAlert.Instance;   client.ApiKey = "SPECIFY_YOUR_API_KEY_HERE";   client.Send(ex); }

Rebuild and Run Your Application

Once your updated application has been redeployed, log in to to review and process incoming reports.

Manual Application Deployment

Skip this step if you are using Visual Studio’s integrated application deployment mechanism. Since you have added Logify Alert client to the project using NuGet, all necessary DLLs will automatically be deployed.

If you are not using Visual Studio’s deployment mechanism, make sure to add the following assemblies to your project’s distribution:

  • Logify.Alert.Core.dll
  • Logify.Alert.Win.dll

Integration with Logging Tools

Logify can automatically record crash reports in your project’s centralized log when using the following logging services:

Terms of use Copyright © 2016-2023 Developer Express Inc.