Initial version

This commit is contained in:
2026-02-27 21:12:55 +01:00
parent d2bbbd8bc7
commit a73beb6ed5
184 changed files with 90370 additions and 63 deletions

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EonaCat.LogStack\EonaCat.LogStack.csproj" />
</ItemGroup>
</Project>

31
ConsoleApp1/Program.cs Normal file
View File

@@ -0,0 +1,31 @@
using EonaCat.LogStack.Configuration;
using EonaCat.LogStack.Core;
var logger = new LogBuilder("MyApp")
.WithMinimumLevel(LogLevel.Information)
.WriteToConsole()
.WriteToFile("C:\\tesss", maxFileSize: 50 * 1024 * 1024)
//.WriteToJsonFile("./logs", maxFileSize: 50 * 1024 * 1024)
//.WriteToHttp("https://127.0.0.1")
//.WriteToUdp("127.0.0.1", 514)
//.WriteToTcp("127.0.0.1", 514)
//.WriteToDatabase(null)
//.WriteToDiscord("https://discord.com/api/webhooks/...")
//.WriteToMicrosoftTeams("https://outlook.office.com/webhook/...")
//.WriteToElasticSearch("http://localhost:9200/logs")
//.WriteToGraylogFlow(null)
//.WriteToZabbixFlow(null)
.BoostWithCorrelationId()
.BoostWithProcessId()
.Build();
while (true)
{
logger.Information("Application started");
logger.Error(new Exception("Nerd!"), "Something went wrong");
await Task.Delay(1);
}
await logger.DisposeAsync(); // Flushes all logs