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)
上一篇 2026年4月17日 下午12:13
下一篇 2026年4月17日 下午12:19


相关推荐

  • 划重点!关于缓冲区溢出攻击,这份防范策略一定要收好!

    划重点!关于缓冲区溢出攻击,这份防范策略一定要收好!一、缓冲区溢出攻击的基本概念缓冲区溢出是一种非常普遍、非常危险的漏洞,在各种操作系统、应用软件中广泛存在。利用缓冲区溢出攻击,可以导致程序运行失败、系统宕机、重新启动等后果。更为严重的是,可以利用它

    2022年6月30日
    33
  • 消息称 Kimi 正进行新一轮 10 亿美元融资,估值已涨至 180 亿美元

    消息称 Kimi 正进行新一轮 10 亿美元融资,估值已涨至 180 亿美元

    2026年3月14日
    2
  • 周末日记

    周末日记书上说人要长大三次第一次是在发现自己不是世界中心的时候第二次是在发现即使再怎么努力终究还是有些事令人无能为力的时候第三次是在明知道有些事可能会无能为力但还是会尽力争取的时候

    2022年6月4日
    51
  • C++中的单例模式

    C++中的单例模式单例模式也称为单件模式 单子模式 可能是使用最广泛的设计模式 其意图是保证一个类仅有一个实例 并提供一个访问它的全局访问点 该实例被所有程序模块共享 有很多地方需要这样的功能模块 如系统的日志输出 GUI 应用必须是单鼠标 MODEM 的联接需要一条且只需要一条电话线 操作系统只能有一个窗口管理器 一台 PC 连一个键盘 nbsp nbsp nbsp nbsp nbsp nbsp 单例模式有许多种实现方法 在 C 中 甚至可以直接用一个全局变量做

    2026年3月16日
    2
  • Claude Code和CC switch安装教程,亲测可用

    Claude Code和CC switch安装教程,亲测可用

    2026年3月12日
    2
  • python安装离线包_python离线包

    python安装离线包_python离线包广告关闭腾讯云 11 11 云上盛惠 精选热门产品助力上云 云服务器首年 88 元起 买的越多返的越多 最高返 5000 元 那么我现在开发了一套 python 程序 需要一些模块 怎么运行 二 离线包制作有 2 个解决方案 1 使用 requirement txt 离线安装打包好的包 whl 请参考链接 https blog csdn netwangyanin 这种方案

    2026年3月19日
    2

发表回复

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

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