代码改变世界

elastic APM 中间件顺序

2022-11-30 23:40 by qgbo, 19 阅读, 0 推荐, 收藏, 编辑
摘要:elastic APM 中间件,应该放在最上面。 这样APM middleware 才能抓到最后的状态码,分辨出来那些是失败的请求。 下面middleware 抓住的异常,应该throw APM 中间件,这样APM 才能导航到正确的error。 action 上应该加cancellization, 阅读全文

serilog 动态更新日志级别

2022-11-10 18:11 by qgbo, 277 阅读, 0 推荐, 收藏, 编辑
摘要:使用这个库,更新配置文件,就可以动态更新 日志输出级别。 new LoggerConfiguration().ReadFrom.Configuration(hostingContext.Configuration) 这个Configuration 定义在这儿。 return settingConfi 阅读全文

.netcore log schema and serilog-asp.netcore schema

2022-11-07 17:02 by qgbo, 21 阅读, 0 推荐, 收藏, 编辑
摘要:1. asp.netcore 的 Ilogger 起源这里: services.TryAdd(ServiceDescriptor.Singleton<ILoggerFactory, LoggerFactory>()); services.TryAdd(ServiceDescriptor.Single 阅读全文

.Netcore IOptions<LoggerFilterOptions> 获取的顺序

2022-11-04 13:53 by qgbo, 26 阅读, 0 推荐, 收藏, 编辑
摘要:.net core 配置文件的日志级别 : { "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Trace", "Microsoft.Hosting.Lifetime": "Information" } } } I 阅读全文

mylog

2022-09-14 00:01 by qgbo, 46 阅读, 0 推荐, 收藏, 编辑
摘要:public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter) { var s = st 阅读全文

C# struct

2022-09-13 16:38 by qgbo, 29 阅读, 0 推荐, 收藏, 编辑
摘要:C# struct struct Point{ public int X; public int Y; }var p1= new Point(){X=1,Y=1} var p2= new Point(){X=1,Y=1}p1.X=123; var p3=p1; hashcode of p1 and 阅读全文

Jenkins copyArtifacts/Zip

2022-09-09 15:36 by qgbo, 140 阅读, 0 推荐, 收藏, 编辑
摘要:A job 调用了B job: build job: b 这只是调用,并没有环境上下文的关系 A 里面声明的环境变量,和B是隔离的 A传到B的值,只能以参数形式。 1. archiveArtifacts folder\\a.txt 这个命令会保存这个文件到环境中 2. 上个命令是在B 中,A job 阅读全文

Elastic.Apm 源码解析

2022-09-03 14:30 by qgbo, 102 阅读, 0 推荐, 收藏, 编辑
摘要:源码中有如下 sample: 1 var distributedTracingData = DistributedTracingData.TryDeserializeFromString(args[0]); 2 3 WriteLineToConsole($"Callee process starte 阅读全文

serilog-asp.net 源码解析

2022-08-28 19:12 by qgbo, 83 阅读, 0 推荐, 收藏, 编辑
摘要:这是 serilog-asp.net 的demo: https://github.com/serilog/serilog-aspnetcore/blob/dev/samples/Sample/Program.cs 开始是这一句话 // The initial "bootstrap" logger i 阅读全文

格式化 打印Json 串

2022-08-18 10:25 by qgbo, 52 阅读, 0 推荐, 收藏, 编辑
摘要:using Newtonsoft.Json.Linq; Console.WriteLine("Hello, World!"); var str = "{\"data\":{\"event\":\"$transitions.onSuccess22\",\"toState\":\"abc\",\"toP 阅读全文
上一页 1 2 3 4 5 6 7 8 9 ··· 21 下一页