Updated
This commit is contained in:
@@ -16,6 +16,11 @@ namespace EonaCat.LogStack.Test.Web
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
await using var logger = LogBuilder.CreateDefault("MyApp");
|
||||
|
||||
logger.Information("Application started");
|
||||
logger.Warning("Low memory warning");
|
||||
logger.Error(new Exception("DIT IS MIJN TEST!"), "Unexpected error occurred");
|
||||
|
||||
// Configure the client
|
||||
var centralOptions = new LogCentralOptions
|
||||
@@ -46,6 +51,9 @@ namespace EonaCat.LogStack.Test.Web
|
||||
var logBuilder = new LogBuilder();
|
||||
logBuilder.WithTimestampMode(TimestampMode.Local);
|
||||
logBuilder.WriteToConsole();
|
||||
logBuilder.WriteToFile("./logs", outputFormat: FileOutputFormat.Csv);
|
||||
logBuilder.WriteToFile("./logs", outputFormat: FileOutputFormat.StructuredJson);
|
||||
logBuilder.WriteToFile("./logs", outputFormat: FileOutputFormat.Text);
|
||||
logBuilder.WriteToFile("./logs", outputFormat: FileOutputFormat.Json);
|
||||
logBuilder.WriteToFile("./logs", outputFormat: FileOutputFormat.Xml);
|
||||
logBuilder.WriteToTcp("127.0.0.1", 514);
|
||||
|
||||
Reference in New Issue
Block a user