.NET 框架 Furion v4.3.4 发布,日志模块全新体验
序言
自 Furion v3.9.2 版本有了自主可控的日志组件之后,越来越多的 Furion 框架使用者移除了第三方日志组件选择框架内置的,Furion 框架提供了企业开发所需的几乎所有日志需求。
本期更新主要对日志性能,日志模板,日志功能进行了改进优化。
本期亮点
1. 更加美观的日志模板
[INF] [Microsoft.Hosting.Lifetime] 2022-08-30T15:52:13.7033488+08:00 [ListeningOnAddress] Now listening on: https://localhost:5001 [INF] [Microsoft.Hosting.Lifetime] 2022-08-30T15:52:13.7405477+08:00 [0] Application started. Press Ctrl+C to shut down. [INF] [Microsoft.Hosting.Lifetime] 2022-08-30T15:52:13.7453185+08:00 [0] Hosting environment: Development [INF] [Microsoft.Hosting.Lifetime] 2022-08-30T15:52:13.7482401+08:00 [0] Content root path: D:\Workplaces\OpenSources\Furion\samples\Furion.Web.Entry\ [WRN] [Furion.Application.TestLoggerServices] 2022-08-30T15:52:32.3892150+08:00 [0] 我是一个二配置日志 20 [ERR] [Furion.Application.TestLoggerServices] 2022-08-30T15:52:35.1479371+08:00 [0] 测试日志异常 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ System.Exception: 错误啦 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [INF] [System.Logging.LoggingMonitor] 2022-08-30T15:53:26.3936806+08:00 [0] ┏━━━━━━━━━━━ Logging Monitor ━━━━━━━━━━━ ┣ Furion.Application.TestLoggerServices.GetPerson (Furion.Application) ┣ ┣ 控制器名称: TestLoggerServices ┣ 操作名称: GetPerson ┣ 路由信息: [area]: ; [controller]: test-logger; [action]: person ┣ 请求方式: GET ┣ 请求地址: https://localhost:5001/api/test-logger/person/233 ┣ 来源地址: https://localhost:5001/api/index.html ┣ 浏览器标识: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Edg/104.0.1293.70 ┣ 客户端 IP 地址: 0.0.0.1 ┣ 服务端 IP 地址: 0.0.0.1 ┣ 服务端运行环境: Development ┣ 执行耗时: 56ms ┣ ━━━━━━━━━━━━━━━ 参数列表 ━━━━━━━━━━━━━━━ ┣ Content-Type: ┣ ┣ id (Int32): 233 ┣ ━━━━━━━━━━━━━━━ 返回信息 ━━━━━━━━━━━━━━━ ┣ 原始类型: Furion.Application.Persons.PersonDto ┣ 最终类型: Furion.UnifyResult.RESTfulResult`1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] ┣ 最终返回值: {"StatusCode":200,"Data":{"Id":233,"Name":null,"Age":0,"Address":null,"PhoneNumber":null,"QQ":null,"CreatedTime":"0001-01-01T00:00:00+00:00","Childrens":null,"Posts":null},"Succeeded":true,"Errors":null,"Extras":null,"Timestamp":1661846006385} ┗━━━━━━━━━━━ Logging Monitor ━━━━━━━━━━━ [ERR] [System.Logging.FriendlyException] 2022-08-30T15:53:33.0839966+08:00 [0] Attempted to divide by zero. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ System.DivideByZeroException: Attempted to divide by zero. at Furion.Application.TestLoggerServices.测试直接抛出异常拦截(Int32 id) in D:\Workplaces\OpenSources\Furion\samples\Furion.Application\TestLoggerServices.cs:line 92 at lambda_method108(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [INF] [Microsoft.EntityFrameworkCore.Database.Command] 2022-08-30T15:53:44.1172386+08:00 [Microsoft.EntityFrameworkCore.Database.Command.CommandExecuted] Executed DbCommand (53ms) [Parameters=[@__p_0='1'], CommandType='Text', CommandTimeout='30'] SELECT "p"."Id", "p"."Address", "p"."Age", "p"."CreatedTime", "p"."Name", "p"."UpdatedTime" FROM "Person" AS "p" WHERE "p"."Id" = @__p_0 LIMIT 1 [WRN] [Microsoft.EntityFrameworkCore.Query] 2022-08-30T15:53:49.0965317+08:00 [Microsoft.EntityFrameworkCore.Query.MultipleCollectionIncludeWarning] Compiling a query which loads related collections for more than one collection navigation, either via 'Include' or through projection, but no 'QuerySplittingBehavior' has been configured. By default, Entity Framework will use 'QuerySplittingBehavior.SingleQuery', which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call 'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))'. [INF] [Microsoft.EntityFrameworkCore.Database.Command] 2022-08-30T15:53:49.1180132+08:00 [Microsoft.EntityFrameworkCore.Database.Command.CommandExecuted] Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] SELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId" FROM "Person" AS "p" LEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId" LEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId" LEFT JOIN ( SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId" FROM "PersonPost" AS "p1" INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id" ) AS "t" ON "p"."Id" = "t"."PersonsId" ORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId"
2. 支持 Visual Studio Code 日志收缩、异常日志高亮
3. 提供 RabbitMQ 事件总线使用指南
4. 提供 Log 静态类写日志更多功能
// 创建日志对象 var logger = Log.CreateLogger("日志名称"); // 创建日志工厂 using var loggerFactory = Log.CreateLoggerFactory(builder => { // .... }); // 日志记录 Log.Information("Information"); Log.Warning("Warning"); Log.Error("Error"); Log.Debug("Debug"); Log.Trace("Trace"); Log.Critical("Critical");
5. 提供 MessageCenter 事件总线静态类
// 发送消息(含诸多重载) await MessageCenter.PublishAsync("messageId", new {}); // 动态订阅消息 MessageCenter.Subscribe("messageId", async (ctx) => { Console.WriteLine("我是动态的"); await Task.CompletedTask; }); // 取消订阅 MessageCenter.Unsubscribe("messageId");
本期更新
新特性
- [新增]
AppSettings
配置的ExcludeAssemblies
属性,支持忽略指定程序集扫描 7b7747f- [新增]
Oops.Oh
和Oops.Bah
支持设置额外数据.WithData(data)
#I5O38E- [新增] 定时任务
Crontab.GetSleepMilliseconds(baseTime)
获取下一个发生时间的时间差 d024fae- [新增] 友好异常默认打印异常日志,避免生产环境漏掉重要异常信息 6e3a5bd
- [新增] 日志静态类
Log.CreateLoggerFactory()
静态方法 75c672a- [新增] 事件总线
MessageCenter
静态类,解决从Fur v1.x
版本升级问题 a29fc7c突破性变化
问题修复
- [修复] 生成包含
中文
的JWT Token
解密后出现乱码问题 #I5O397其他更改
- [调整] 默认输出文件日志模板,使其更加美观 #1518cf3
文档
- [新增]
RabbitMQ
事件总线文档- [更新]
AppSettings
配置文档、事件总线文档、多数据库配置文档、日志文档、定时任务文档、MessageCenter
文档

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Metric模块源码解析
分布式系统的监控告警及运维服务离不开指标监控,开务作为浪潮自主研发的一款分布式数据库自然也不例外。在兼顾强一致性、高可用分布式架构、在线水平扩展、企业级安全等特性下,开务的metric模块可提供监控指标,实现预先定义指标的周期性采集。同时,可以提供兼容 Prometheus 标准格式的 API 接口,方便与外部的 Prometheus 服务进行集成。 开务数据库metric 模块收集各模块相关统计的metric 信息,并将其作为 Prometheus 格式的指标储存起来用于进一步查阅,对判断开务数据库的运行情况有着重要作用,同时也是开务数据库adminUI 指标的数据来源。本期内容将围绕下图展示的metric模块基本框架,带领大家深入了解开务数据库metric 模块的源码,图中各模块的详细介绍将持续为大家更新。 1、定义接口介绍 1.IterableIterable:提供了一个同步访问内部对象的方法。方法如下: GetName() string 返回指标名 GetHelp() string 返回指标帮助文本 GetMeasurement() string 返回指标的lable GetU...
- 下一篇
ShopWind V3.4.3 更新 | webIM客服模块新体验
ShopWind 是一款基于 Yii2.0 框架深度重构的 B2B2C、O2O 行业的电商系统软件,您可以轻松创建和发布属于自己品牌的专业的电商平台,进行全方位的品牌宣传和产品推广。ShopWind v3.x 标准版开始走向开源,打造一款完全开源的电商系统,可以免费用于商业运营或者二次开发,免于商业版权的烦恼。v3.x 商业版包含 PC、手机 H5、微商城、APP 客户端(Andorid+iOS)、微信小程序、今日头条小程序等多端,其中 PC 端为开源免费项目,移动端为增值项目。ShopWind 提供专业、快速、安全的底层软件设计和免费的更新升级服务,做好完善的开发文档和接口文档方便开发者在底层软件的基础上开发各种应用、模板、或者插件。新版本新增了社区团购模块,可以搭建类似于橙心优选,美团优选等社区团购 O2O 类型的网站系统平台。 官网网址:https://www.shopwind.net 开发文档:https://developer.shopwind.net API 接口文档:http://docs.shopwind.net 开发者社区:https://forum.shopwind...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- CentOS7,8上快速安装Gitea,搭建Git服务器
- CentOS关闭SELinux安全模块
- CentOS8编译安装MySQL8.0.19
- CentOS8安装Docker,最新的服务器搭配容器使用
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- Docker安装Oracle12C,快速搭建Oracle学习环境
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- Red5直播服务器,属于Java语言的直播服务器
- Windows10,CentOS7,CentOS8安装Nodejs环境