ABP vNext中使用开源日志面板 LogDashboard
生活随笔
收集整理的這篇文章主要介紹了
ABP vNext中使用开源日志面板 LogDashboard
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
ABP vNext 使用 logdashboard
本文示例源碼:
https://github.com/liangshiw/LogDashboard/tree/master/samples/abpvnext
ABP
ABP是aspnetcore3.0的開源web應用程序框架,非常適合現(xiàn)代web應用程序。有關ABP的更多內容可以查看官方文檔
Logdashboard可以直接在基于abp應用程序中安裝使用,關于Logdashboard的更多內容可以查看ASPNETCore開源日志面板 :LogDashboard
示例
本文假設你了解ABP,并不對其做詳細解釋
使用?abp cli?創(chuàng)建項目
abp new BootStore使用以下代碼覆蓋Program?中的Serilog配置
Log.Logger = new LoggerConfiguration()#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.log", outputTemplate: "{Timestamp:HH:mm} || {Level} || {SourceContext:l} || {Message} || {Exception} ||end {NewLine}"))
.CreateLogger();
安裝LogDashboard
Install-Package LogDashboard打開?BootStoreWebModule?類
在ConfigureServices?方法末尾添加以下代碼
context.Services.AddLogDashboard(opt => opt.SetRootPath(hostingEnvironment.ContentRootPath));在OnApplicationInitialization?方法末尾添加以下代碼
app.UseLogDashboard();遷移后運行項目,導航到/logdashboard
enjoy
原文鏈接:https://www.cnblogs.com/LiangSW/p/11933311.html
.NET社區(qū)新聞,深度好文,歡迎訪問公眾號文章匯總?http://www.csharpkit.com?
總結
以上是生活随笔為你收集整理的ABP vNext中使用开源日志面板 LogDashboard的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [原]排错实战——使用process e
- 下一篇: GitHub Actions,卧槽!牛批