9q13nh 发表于 2024-9-27 10:03:36

WatchDog:一款.NET开源的实时应用监控系统


    <div style="color: black; text-align: left; margin-bottom: 10px;">
      <div style="color: black; text-align: left; margin-bottom: 10px;">
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/4639185368394e119d981581f97d5f70~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=F57O6D%2BHJqBDytot6oMJk2X0v58%3D" style="width: 50%; margin-bottom: 20px;"></p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/0b7aab94d84558e66348a04a4e85a7a8~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=4sHERfcyV16UHVxQSU6fe23u2qA%3D" style="width: 50%; margin-bottom: 20px;"></p>
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">项目介绍</span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">WatchDog是一个开源(MIT License)、免费、针对ASP.Net Core Web应用程序和API的实时应用监控系统。<span style="color: black;">研发</span>者<span style="color: black;">能够</span>实时记录和查看<span style="color: black;">她们</span>的应用程序中的<span style="color: black;">信息</span>、事件、HTTP请求和响应,以及运行时<span style="color: black;">捕捉</span>的<span style="color: black;">反常</span>。</p><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/7e76b11505917b3be06e2c35af535c1d~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=MVzE04Prxp9SrR%2FjGGR%2BZkbwD2o%3D" style="width: 50%; margin-bottom: 20px;">
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">项目工作原理</span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">它利用SignalR进行实时监控,并<span style="color: black;">运用</span>LiteDB<span style="color: black;">做为</span>无需配置的类似MongoDB的无服务器数据库,<span style="color: black;">同期</span><span style="color: black;">亦</span>支持<span style="color: black;">运用</span><span style="color: black;">外边</span>数据库(如MSSQL、MySQL、Postgres、MongoDB)。</p>
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">支持.NET版本</span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">.NET Core 3.1 及更高版本。</p>
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">项目源代码</span></h2><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/895a6f033b922a1ef394b3223d7a066b~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=3F8llvc6bt2%2FQ2sjMUbF14xdkqE%3D" style="width: 50%; margin-bottom: 20px;">
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">WatchDog安装</span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">搜索WatchDog.NETNuGet包安装:</p><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/afdf03c482aa47f87a675b8fccfd3014~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=zalkQZp6Ie5qBURKYLZ4dIIj02I%3D" style="width: 50%; margin-bottom: 20px;">
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">WatchDog服务注册</span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在ASP.NET Core Web API的Program.cs中注册WatchDog服务:</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">builder.Services.AddWatchDogServices(opt =&gt;</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">{</p> opt.IsAutoClear = <span style="color: black;">true</span>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">;</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">opt.ClearTimeSchedule = WatchDogAutoClearScheduleEnum.Monthly;</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> opt.DbDriverOption = WatchDogDbDriverEnum.Mongo;</p> opt.SetExternalDbConnString = <span style="color: black;">"mongodb://localhost:27017"</span>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">;</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">});</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">builder.Logging.AddWatchDogLogger();</p>
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">添加<span style="color: black;">反常</span>记录器</span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">app.UseWatchDogExceptionLogger();</p>
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">设置<span style="color: black;">拜访</span>日志的账号<span style="color: black;">秘码</span></span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">app.UseWatchDog(conf =&gt;</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">{</p> conf.WatchPageUsername = <span style="color: black;">"Admin"</span>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">;</p> conf.WatchPagePassword = <span style="color: black;">"9999999999"</span>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">;</p> conf.Blacklist = <span style="color: black;">"/auth, user"</span>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">;</p>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">});</p><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/d297362bb8332000ccc8456c12e23f22~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=nYvf5tw7XGu%2FgjYi2h%2FaAT82sIc%3D" style="width: 50%; margin-bottom: 20px;">
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">项目监控截图</span></h2><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/6f0ef0447f24c3d8e77fc3cc45bee044~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=m0vrzHsOsTumEPU0CAXGGn9y4dk%3D" style="width: 50%; margin-bottom: 20px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/6a0f6accfba8baa99840c3f1cc010a1e~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=P3sBVQLGqy7YPWzjd80SCnjaAVY%3D" style="width: 50%; margin-bottom: 20px;"><img src="https://p3-sign.toutiaoimg.com/tos-cn-i-tjoges91tu/0a2e3c6c071a6baa646ccfffe150d937~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1727342968&amp;x-signature=pOsLFfuuMA5bAdLN3V2FrvCCV8Y%3D" style="width: 50%; margin-bottom: 20px;">
            <h2 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">项目源码<span style="color: black;">位置</span></span></h2>
            <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">更加多</span>项目实用功能和特性欢迎前往项目开源<span style="color: black;">位置</span>查看
页: [1]
查看完整版本: WatchDog:一款.NET开源的实时应用监控系统