Лог и трассировка - Seriolog 

Page / - Изменено Alexandr Fokin в 2023/12/17 12:09 

Seriolog 
Изменено Alexandr Fokin
в 2023/12/17 12:09

Оглавление

Seriolog	https://serilog.net
https://github.com/serilog/serilog	
 	Структурированное логирование	
 	Структурное логирование на примере Serilog и Seq
https://habr.com/ru/articles/266299/
Structured logging with Serilog and Seq and ElasticSearch under Docker
https://dev.to/hasdrubal/structure-logging-with-serilog-and-seq-and-elasticsearch-under-docker-16dk	
 	Интеграция с Microsoft. Extensions. Logging	Serilog. Extensions. Logging
https://github.com/serilog/serilog-extensions-logging	 	
Open Search	Serilog. Sinks. OpenSearch
https://github.com/villejuhanilaakso/serilog-sinks-opensearch
OpenSearch for .NET	var seriologConf = new LoggerConfiguration()
    .Enrich
    .FromLogContext();

seriologConf.WriteTo.OpenSearch(
    options: new OpenSearchSinkOptions(
       new Uri("https://<ip>:<port>")
        )
    {
        ModifyConnectionSettings = (s) => 
        {
            s
                .BasicAuthentication("admin", "admin")
                .EnableDebugMode(
                    e => 
                    {
                       //breakpoint
                   }                                    
                    )
                .ThrowExceptions(true)
                .ServerCertificateValidationCallback(static (_,_,_,_) => true);

           return s;
        }
    }
    );

logger = seriologConf.CreateLogger();	
Seq