-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMyService.cs
More file actions
28 lines (24 loc) · 837 Bytes
/
MyService.cs
File metadata and controls
28 lines (24 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Microsoft.ApplicationInsights;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
namespace Functions_V3_sample
{
public class MyService
{
public MyService(ILogger<MyService> logger, TelemetryClient telemetry)
{
Logger = logger ?? throw new ArgumentNullException(nameof(logger));
Telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
}
public void Foo()
{
Logger.LogInformation("Foo");
Telemetry.TrackTrace("BarLog", Microsoft.ApplicationInsights.DataContracts.SeverityLevel.Information);
Telemetry.TrackEvent("BarEvent");
}
public ILogger<MyService> Logger { get; }
public TelemetryClient Telemetry { get; }
}
}