Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

serilog .net 6

var builder = WebApplication.CreateBuilder(args);

builder.Host.UseSerilog((ctx, lc) => lc
    .WriteTo.Console()
    .WriteTo.Seq("http://localhost:5341"));

var app = builder.Build();
Comment

serilog asp.net 5

?
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
29
30
31
32
public class Program
{
    public static void Main(string[] args)
    {
        Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Information()
            .WriteTo.Debug()
            .CreateLogger();
 
        try
        {
            Log.Information("Starting Web Host");
            CreateHostBuilder(args).Build().Run();
        }
        catch (Exception ex)
        {
            Log.Fatal(ex, "Host terminated unexpectedly");
        }
        finally
        {
            Log.CloseAndFlush();
        }
    }
 
    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .UseSerilog()
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            });
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# property attribute 
Csharp :: .net core get runtime version 
Csharp :: usermanager find based on role 
Csharp :: console writeline 
Csharp :: c# async and await example 
Csharp :: unity GUI TextField enter 
Csharp :: check if multiple variables are null c# 
Csharp :: escape chars for regex c# 
Csharp :: Generic Stack in c# 
Csharp :: count number of specific characters in string c# 
Csharp :: c# check if character is lowercase 
Csharp :: convert json date to datetime c# 
Csharp :: oauth API with the Access Token to retrieve some of users information. 
Csharp :: c# linq join mutiple 
Csharp :: implicit vs explicit cast c# 
Csharp :: Transpose Matrix C Sharp 
Csharp :: math.pow in C# using loop 
Csharp :: unity read console log 
Csharp :: round image unity 
Csharp :: rotate skybox on x axis unity 
Csharp :: unity SceneTemplatePipeline 
Csharp :: 1180 beecrowd URI 
Csharp :: no cameras rendering unity 
Csharp :: c# windows forms rtc 
Csharp :: nullable IList to List 
Csharp :: Boolean Literals 
Csharp :: Handlebars c# datetime now 
Csharp :: c# function to validate decimal upto p(25,2) 
Csharp :: upload file add more size webconfig in asp.net mvc 
Csharp :: principalcontext c# example 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =