Skip to content

1. Getting started guide

Chingiz Olzhabaev edited this page Aug 7, 2023 · 11 revisions

Before starting

We preperad 2 min video about how to install and use Diol. Please don't forget to like the video and subscribe to the channel (^_^)

Prerequisites

Visual studio extension

  1. Open your VS
  2. Go to Extensions -> Manage Extensions
  3. Search Diol
  4. Install

How to open the extension

  1. Go to Views -> Other Windows -> Diol ("IO" icon)
  2. The tool window should be opened
  3. You can attach it to some place.
  4. Don't forget to click Sync button

image

Cool, now we are ready to start!

How to use

  1. Create new asp.net core application or use our example link. In the example we will show our sample. image
  2. Add several things (if you created your own app):
  • in Program.cs -> builder.Services.AddHttpClient();
  • in Program.cs -> app.UseHttpLogging();
  • in appsettings.Development.json
{
  "DetailedErrors": true,
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning",
      "Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Trace",
      "System.Net.Http.HttpClient": "Trace"
    },
    "EventSource": {
      "LogLevel": {
        "Default": "None",
        "Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Trace",
        "System.Net.Http.HttpClient": "Trace"
      }
    }
  }
}
  1. Run with debug your application

Note

There is a known issue where Visual Studio debugger may cause invalid Activity IDs to be generated. Either don't run this sample under the debugger or set a breakpoint at the beginning of Main and evaluate the expression 'System.Threading.Tasks.TplEventSource.Log.TasksSetActivityIds = false' in the immediate window before continuing to work around the issue.

Documentation

  1. Open Diol
  2. Click Start in Diol Tool windows image
  3. Add breakpoint to /api/process-id endpoint.
  4. Navigate to swagger page (http://localhost:[<your_port>]/swagger
  5. Call GET /api/process-id
  6. You should see a new row in 'Aspnet core' tab (Diol tool window) image
  7. Press Continue debugging and return to Diol
  8. You also can click on row and see detail information! image

Congrats!

More information

How to setup logs

Http

  1. Add builder.Services.AddHttpClient(); in program.cs
  2. Update appsettings.development.json
"EventSource": {
      "LogLevel": {
        "Default": "None",
        "System.Net.Http.HttpClient": "Trace"
      }
    }

Aspnet

  1. Add in program.cs
builder.Services.AddHttpLogging(options =>
{
    options.LoggingFields = HttpLoggingFields.All;
});
  1. Add app.UseHttpLogging(); in program.cs
  2. Update appsettings.development.json
"EventSource": {
      "LogLevel": {
        "Default": "None",
        "Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Trace"
      }
    }

EntityFramework

  1. Add EF to your project
  2. Update 'appsettings.development.json'
"EventSource": {
      "LogLevel": {
        "Default": "None",
        "Microsoft.EntityFrameworkCore": "Trace"
      }
    }

In progress

  1. We are working on a solution for Diol Backend Service installation process. Until this you should run it once
  2. We are working on a solution to not click sync and start manually.