Adds SeqLogger working

This commit is contained in:
Janus Knudsen 2025-02-17 17:42:46 +01:00
parent 1aea1e894a
commit 440087c43b
4 changed files with 315 additions and 63 deletions

View file

@ -21,34 +21,34 @@ namespace Tests
conn.ExecuteSql("SELECT 1 as p");
}
static HttpClient _client = new HttpClient();
[TestMethod]
public async Task MyTestMethod()
{
_client.BaseAddress = new Uri("http://localhost:5341");
//static HttpClient _client = new HttpClient();
//[TestMethod]
//public async Task MyTestMethod()
//{
// _client.BaseAddress = new Uri("http://localhost:5341");
var l = new SeqLogger(_client, "", "");
// var l = new SeqLogger(_client, "", "");
for (int i = 0; i < 20; i++)
{
// for (int i = 0; i < 20; i++)
// {
await l.LogToSeq(
"Bruger {UserId} loggede ind",
"Debug",
new Dictionary<string, object> { { "UserId", "12345" }, { "Counter", i++ } }
);
}
var logger = Container.Resolve<Microsoft.ApplicationInsights.TelemetryClient>();
// await l.LogToSeq(
// "Bruger {UserId} loggede ind",
// "Debug",
// new Dictionary<string, object> { { "UserId", "12345" }, { "Counter", i++ } }
// );
// }
// var logger = Container.Resolve<Microsoft.ApplicationInsights.TelemetryClient>();
for (int i = 0; i < 5; i++)
{
// for (int i = 0; i < 5; i++)
// {
logger.TrackTrace("Hello 23", Microsoft.ApplicationInsights.DataContracts.SeverityLevel.Information);
// logger.TrackTrace("Hello 23", Microsoft.ApplicationInsights.DataContracts.SeverityLevel.Information);
}
// }
}
//}
[TestMethod]
public void TryOrganizationSetupService()