openfiledialog控件_ASP 第三方控件

openfiledialog控件_ASP 第三方控件Logdashboard1.1beta.在AspNetMvc中使用日志面板Logdashboard是Net下的日志面板,它支持AspNet与AspNetCore项目。关于更多LogDashboard的介绍请看这里。就在刚刚LogDashboard发布了1.1的beta版,在这个版本中有以下变化https://github.com/liangshiw/LogDashboard/releas…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

Logdashboard 1.1beta. 在AspNetMvc中使用日志面板

Logdashboard是Net下的日志面板,它支持AspNet与AspNetCore项目。关于更多LogDashboard的介绍请看这里

就在刚刚LogDashboard发布了1.1的beta版,在这个版本中有以下变化
https://github.com/liangshiw/LogDashboard/releases

  • 支持NetFramework的AspNetMvc项目
  • 走势图添加更多趋势
  • 支持serilog日志组件
  • 异步查询日志

在AspNetMvc中使用日志面板

示例源码 : https://github.com/liangshiw/LogDashboard/tree/master/samples/NfxAspNetMvc

使用VisualStudio创建一个AspNetMvc项目,命名为 NfxAspNetMvc

配置Nlog

在程序包管理控制台安装 Nlog.Web
Install-Pakcage Nlog.Web

将下面的Nlog.config添加到项目中,并且配置复制到目录

<?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" throwExceptions="false" internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log"> <!-- optional, add some variables https://github.com/nlog/NLog/wiki/Configuration-file#variables --> <variable name="myvar" value="myvalue"/> <!-- See https://github.com/nlog/nlog/wiki/Configuration-file for information on customizing logging rules and outputs. --> <targets> <target xsi:type="file" name="File" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate}||${level}||${logger}||${message}||${exception:format=ToString:innerFormat=ToString:maxInnerExceptionLevel=10:separator=\r\n}||end" /> <!-- Write events to a file with the date in the filename. --> </targets> <rules> <logger name="*" minlevel="Debug" writeTo="file" /> <!-- add your logging rules here --> <!-- Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f" <logger name="*" minlevel="Debug" writeTo="f" /> --> </rules> </nlog>

打开WebConfig 将下面的modules节点配置复制到 WebConfig

<modules runAllManagedModulesForAllRequests="true"> <remove name="TelemetryCorrelationHttpModule" /> <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" /> <add name="NLog" type="NLog.Web.NLogHttpModule, NLog.Web" /> </modules>

打开 HomtController 使用logger 写一条日志

public ActionResult Index() { //var logger = logger var logger = LogManager.GetCurrentClassLogger(); logger.Info("HomeController index action"); return View(); }

安装LogDashboard

logDashboard在AspNetMvc中依赖Owin中间件,首先我们先安装 Microsoft.Owin.Host.SystemWeb

Install-Package Microsoft.Owin.Host.SystemWeb

下面安装LogDashboard 因为是预发布版,在安装的时候需要指定版本

Install-Package LogDashboard -Version 1.1.0-beta

最后我们添加Owin Startup类,在添加时搜索owin会出现该条目,在Startup中配置LogDashboard中间件

public void Configuration(IAppBuilder app) { app.MapLogDashboard(typeof(Startup).Assembly, opt => { opt.SetRootPath(AppContext.BaseDirectory); }); }

这时运行项目并导航到 /logdashboard 就会看到日志面板,与我们添加的日志消息 HomeController index action

832799-20190123182457412-997077935.png

走势图

在1.1中添加了以小时、天、周、月为单位的日志趋势图

832799-20190123182603280-2136954267.gif

支持serilog

除了log4net、Nlog之外 LogDashboard还加入了serilog的支持与示例

示例源码:https://github.com/liangshiw/LogDashboard/tree/master/samples/UseSerilog
大家可以自行下载体验

异步查询日志

我fork了 https://github.com/tmsmith/Dapper-Extensions ,添加了NetStandard版本的异步查询支持,并发布了Nuget包 https://www.nuget.org/packages/DapperExtensions.Standard/
在LogDashboard中实现了数据库的异步查询

More

Logdashboard官网

LogDashboard文档

仓库地址

欢迎入群交流

51227366-df111580-198e-11e9-9e0c-f7b077e63fe7.png

转载于:https://www.cnblogs.com/LiangSW/p/10310681.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/188194.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 反演定理及其应用_反演定理的证明

    反演定理及其应用_反演定理的证明一、莫比乌斯反演莫比乌斯反演公式:若F(n)=∑i|nf(i)F(n)=∑i|nf(i)F(n)=\sum_{i|n}f(i)则f(n)=∑i|nμ(i)F(ni)f(n)=∑i|nμ(i)F(ni)f(n)=\sum_{i|n}\mu(i)F(\frac{n}{i})为什么呢?请看证明:由于莫比乌斯函数具有性质∑i|nμ(i)=[n=1]∑i|nμ(i)=[n=1]\…

    2022年10月22日
    1
  • css常见布局

    css常见布局基础版 1 两列布局两列布局是一侧固定 另一侧自适应 一般一个浮动 另一个设置 margin 或者一个绝对定位 另一个设置 margin 代码如下 浮动方法 style gt left float left width 200px background green height 200px right

    2025年7月30日
    1
  • floyed详解[通俗易懂]

    floyed详解[通俗易懂]显然Floyed算法是一个简短而好理解的算法,这里指的好理解是因为Floyed的代码长度不大,实在没理解都可以背下来,所以说是好理解,实际上是真的好理解吗?我们来看看最基础的FloyedFloyed是什么?自然是用来求多源最短路的啦,时间效率是O(n^3),有人会问那我不对每个点做一遍SPFA或dijkstra堆优化,时间效率是O(n^2logn)那不是快很多?实际上因为Floyed

    2022年6月16日
    22
  • 【2022年更新】手把手教你去除 WinRAR 的弹窗广告

    【2022年更新】手把手教你去除 WinRAR 的弹窗广告WinRAR作为知名的老牌压缩软件,二十余年来始终风靡全球,经久不衰。但对于中国用户,其简体中文的个人免费版安装后会有“评估版本”的标记,而且每次启动时会有代理商的弹窗广告。本文教你如何去除标记和弹窗广告,让你的WinRAR恢复纯净体验。

    2022年6月5日
    36
  • VCR连接_服务器出问题了怎么办

    VCR连接_服务器出问题了怎么办VC连接服务器过程:1.     服务器端创建端口a)       使用一个侦听子类来创建如CListenSocket*m_pSocket,这个子类中重载Socket函数OnAccept(intnErrorCode),在OnAccept函数中主要完成服务器端纪录并保存客户端的信息。VoidCListenSocket::OnAccept(intnErrorCode){      //先

    2022年8月12日
    6
  • db4o 参考资料

    db4o 参考资料转自IBM:http://www.ibm.com/developerworks/cn/java/jdb4o/本系列是对开放源码数据库db4o的详尽介绍,db4o可以充分利用当前的面向对象的语言、系统和理念。要下载db4o,可以参考db4o主页;为了实践本系列的示例,需要下载db4o。系列文章第1部分:简介和概览(2007年4月9日)

    2022年7月21日
    17

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号