-
Notifications
You must be signed in to change notification settings - Fork 0
2. Diol backend service
Chingiz Olzhabaev edited this page Jul 12, 2023
·
4 revisions
Diol.Core
depends on:
- Navigate to DiolBackendService
- Call
dotnet build
- Call
dotnet run
- New web app should opened in your browser
- Click
connect
- Provide
process id
- Click 'Start'
We are good hear!
Then, navigate to your application and make some request.
You should see logs rows.
-
Learn more information about aspnet signal r and chouse correct client version (js, C# and etc.). Documentation
-
Create connection
const connection = new signalR.HubConnectionBuilder()
.withUrl("/logsHub")
.configureLogging(signalR.LogLevel.Information)
.build();
- Subscribe to
LogRecievedE
function logsReceivedHanndler(categoryName, eventName, dataAsJson) {
// categoryName -> 'HttpClient', 'AspnetCore' and etc
// eventName -> Dto name
let data = JSON.parse(dataAsJson);
console.info(categoryName, eventName, data );
}
connection.on('LogReceived', logsReceivedHanndler);
- Connect to signal r hub
connection.start();
- Start processing
let processId = <some_dotnet_process_id>;
connection.invoke('Subscribe', processId);
Hub name: LogsHub
Url: /logsHub
Type: Signalr core hub
You can find all events and dtos in the repo
- GetProcesses
- Subscribe
Arguments:
- message | string
Description:
Ask from the server a list with dotnet processes. The result will be sended as an event 'ProcessesReceived'
Arguments:
- processId | int
Description:
Start processing a dotnet process. In client side you will recieve 'ProcessingStarted' event.
- ProcessesReceived
- ProcessingStarted
- ProcessingFinished
- LogReceived
Result: list of dotnet processes.
Result: id of process
Result: id of process
This event happen every time when the process recieve logs.
result:
- CategoryName |
Logs Events
- EventName |
Dto
name - Data | data as string json
- HttpClient
- AspnetCore
- Entity Framework
- WebSockets
Order | Name | Dto |
---|---|---|
1 | RequestPipelineStartDto | RequestPipelineStartDto |
2 | RequestPipelineRequestHeaderDto | RequestPipelineRequestHeaderDto |
3 | RequestPipelineEndDto | RequestPipelineEndDto |
4 | RequestPipelineResponseHeaderDto | RequestPipelineResponseHeaderDto |
Order | Name | Dto |
---|---|---|
1 | RequestLogDto | RequestLogDto |
2 | RequestBodyDto | RequestBodyDto |
3 | ResponseLogDto | ResponseLogDto |
4 | ResponseBodyDto | ResponseBodyDto |
Order | Name | Dto |
---|---|---|
1 | ConnectionOpeningDto | ConnectionOpeningDto |
2 | CommandExecutingDto | CommandExecutingDto |
3 | CommandExecutedDto | ConnectionOpeningDto |
Coming soon...
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'HttpClient' |
EventName | string | defaultValue: 'RequestPipelineStartDto' |
HttpMethod | string | Get, post, put and etc. |
Uri | string | request url |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'HttpClient' |
EventName | string | defaultValue: 'RequestPipelineRequestHeaderDto' |
Headers | Dictionary<string, string> | Request headers. key - is header name, value is header value |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'HttpClient' |
StatusCode | int | 200, 404, 500 and etc. |
ElapsedMilliseconds | TimeSpan | request duration |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'HttpClient' |
EventName | string | defaultValue: 'RequestPipelineRequestHeaderDto' |
Headers | Dictionary<string, string> | Reponse headers. key - is header name, value is header value |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'AspnetCore' |
EventName | string | defaultValue: 'RequestLogDto' |
Protocol | string | http1, http2 and etc. |
Method | string | get, post, put and etc. |
Scheme | string | http, https and etc. |
Host | string | domain name |
Path | string | paht. like api/some-resource
|
Metadata | Dictionary<string, string> | request headers. |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'AspnetCore' |
EventName | string | defaultValue: 'RequestLogDto' |
BodyAsString | string | request body as string |
Metadata | Dictionary<string, string> |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'AspnetCore' |
EventName | string | defaultValue: 'RequestLogDto' |
StatusCode | int | 200, 404 and etc. |
ContentType | string | application/json or etc. |
Metadata | Dictionary<string, string> | Response headers |
Field | Type | Info |
---|---|---|
CategoryName | string | defaultValue: 'AspnetCore' |
EventName | string | defaultValue: 'RequestLogDto' |
BodyAsString | string | response body as string |
Metadata | Dictionary<string, string> |
Field | Type | Info |
---|---|---|
Database | string | |
Server | string |
Field | Type | Info |
---|---|---|
Parameters | string | |
CommandText | string | SELECT * FROM YOUR_TABLE |
Field | Type | Info |
---|---|---|
ElapsedMilliseconds | TimeSpan | Execution time |
- We use
CorrelationId
to group up events. For some reasons thatCorrelationId
can be wrong if you call Tasks in your source code. We are still in progress to resolve this issue