This article was sponsored by Rollbar. Thank you for supporting the sponsors who make SitePoint possible.
本文由Rollbar赞助。 感谢您支持使SitePoint成为可能的赞助商。
As a SitePoint reader, you write perfect error-free code on every project…
作为SitePoint阅读器,您可以在每个项目上编写完美的无错误代码。
But can you say the same for every member of your team?
但是您能对团队中的每个成员说同样的话吗?
The more sophisticated your product, the larger your team and the more bugs you’ll discover. You may have robust testing procedures, but can you be sure the latest edition of your framework is error-free? What about third-party modules, databases and components? Is the language or runtime perfect? Are you certain about the underlying deployment Operating System? Can the whole stack be considered fool-proof for the most foolish of users?!
您的产品越复杂,您的团队就越大,您将发现更多的错误。 您可能具有健全的测试程序,但是可以确定最新版本的框架没有错误吗? 第三方模块,数据库和组件呢? 语言或运行时是否完美? 您是否确定基础部署操作系统? 对于最愚蠢的用户,整个堆栈是否可以视为傻瓜?
Understanding that errors are inevitable is the first step. The considerably more complex second step is recording errors, tracking frequencies, prioritizing issues, coding a solution, testing the fixes and deploying to a live server. Without careful management, teams can spend longer fixing bugs than writing new code.
第一步是要了解错误是不可避免的。 第二步要复杂得多,这是记录错误,跟踪频率,确定问题的优先级,编码解决方案,测试修补程序并部署到实时服务器。 没有仔细的管理,与编写新代码相比,团队可能花费更多的时间来修复错误。
Fortunately, Rollbar can drastically reduce debugging time and costs. The service is trusted by companies such as Heroku, Walmart, LogMeIn, Lyft, Twitch and Intuit to centrally manage critical errors on web sites, web applications, mobile and desktop apps.
幸运的是, Rollbar可以大大减少调试时间和成本。 该服务受到 Heroku,Walmart,LogMeIn,Lyft,Twitch和Intuit等公司的信任,可以集中管理网站,Web应用程序,移动和桌面应用程序上的严重错误。
At the time of writing, Rollbar has logged almost 13 billion errors (and that’s just my shoddy code!).
在撰写本文时, Rollbar已记录了将近130亿个错误(那只是我的伪劣代码!) 。
Rollbar unites your tools into one seamless error-handling workflow. A few minutes of set-up can save considerable effort over the longer term.
Rollbar将您的工具组合到一个无缝的错误处理工作流程中 。 从长远来看,几分钟的设置可以节省大量的精力。
Sign up from the Rollbar home page for an initial free trial. You can use an email address or link your GitHub account.
从Rollbar主页注册以进行初始免费试用。 您可以使用电子邮件地址或链接您的GitHub帐户。
A quick set-up guide runs the first time you log in.
首次登录时,将运行快速设置指南。
Enter a project name and choose from one of the many languages and frameworks. All popular mobile, desktop and web back and front-end platforms are available.
输入项目名称,然后从多种语言和框架中选择一种。 所有流行的移动,桌面和Web后端和前端平台均可用。
On creation, your project is assigned a unique access token which identifies all messages sent to the Rollbar system.
创建后,将为您的项目分配一个唯一的访问令牌,该令牌标识发送到Rollbar系统的所有消息。
Integration will vary according to your project’s language. For PHP, you can install a Rollbar component using Composer or by downloading two files. Include rollbar.php, initialize and send a test message:
集成将根据您项目的语言而有所不同。 对于PHP,可以使用Composer或下载两个文件来安装Rollbar组件 。 包括rollbar.php,初始化并发送测试消息:
<?php // include Rollbar component require_once 'rollbar.php'; // initialize Rollbar Rollbar::init(array('access_token' => 'your-project-token')); // send a test message Rollbar::report_message('testing 123', 'info');You can then add one or more exception handlers to capture all errors:
然后,您可以添加一个或多个异常处理程序以捕获所有错误:
// catch exception and send to Rollbar try { throw new Exception('test exception'); } catch (Exception $e) { Rollbar::report_exception($e); }For Node.js Express projects, you can install the Rollbar module using npm:
对于Node.js Express项目,可以使用npm安装Rollbar模块:
npm install --save rollbarThen add Rollbar error-handling middleware:
然后添加Rollbar错误处理中间件:
var rollbar = require('rollbar'), express = require('express'), app = express(); // Rollbar middleware app.use(rollbar.errorHandler('your-project-token')); // basic route app.get('/', function (req, res) { res.send('Hello World!'); }); // start server app.listen(3000);Rollbar provides notification libraries for Android, Clojure, ColdFusion, Dart, Erlang, Flash, Go, Haskell, iOS, Java, JavaScript (client), .NET, Node.js, PHP, Python, Ruby and web server logs. Alternatively, you can use the fully documented RESTful API for other languages.
Rollbar为Android,Clojure,ColdFusion,Dart,Erlang,Flash,Go,Haskell,iOS,Java,JavaScript(客户端)、. NET,Node.js,PHP,Python,Ruby和Web服务器日志提供通知库。 另外,您可以将完整记录的RESTful API用于其他语言。
The Rollbar dashboard provides a live overview of all errors with the frequency of occurrence:
Rollbar仪表板提供了所有错误的实时概述以及发生的频率:
You can analyze individual issues to:
您可以分析单个问题以:
track the users, devices and browsers affected 跟踪受影响的用户,设备和浏览器 locate similar or related errors 找到类似或相关的错误 discuss the issues with other team members, and 与其他团队成员讨论问题,以及 replay web service calls to reproduce the same error. 重播Web服务调用以重现相同的错误。From the Settings panel you can also:
在“ 设置”面板中,您还可以:
add further team collaborators 添加其他团队合作者 apply grouping rules to reduce noise, and 应用分组规则以减少噪音,以及 connect other services… 连接其他服务…Team members will have differing notification and issue-tracking preferences. Rollbar allows you send alerts and tasks via a range of popular channels including email, GitHub issues, BitBucket issues, JIRA, Pivotal Tracker, Trello, PagerDuty, Slack and more:
团队成员将具有不同的通知和问题跟踪首选项。 Rollbar允许您通过一系列受欢迎的渠道发送警报和任务,包括电子邮件,GitHub问题,BitBucket问题,JIRA,Pivotal Tracker,Trello,PagerDuty,Slack等:
You can assign a developer to a task from the dashboard and know it has been updated in their bug-tracking tool of choice.
您可以从仪表板向开发人员分配任务,并在其所选的错误跟踪工具中知道该任务已更新。
Finally, Rollbar can be integrated with deployment platforms such as Heroku, Capistrano, Engine Yard and Fabric. Rollbar monitors the deployed fixes and marks issues as “resolved” on all connected services.
最后,Rollbar可以与部署平台集成,例如Heroku,Capistrano,Engine Yard和Fabric。 Rollbar监视已部署的修补程序,并将所有连接的服务上的问题标记为“已解决”。
Not every fix goes to plan, so Rollbar will alert you immediately whenever a historical regression occurs.
并非所有修复计划都如期进行,因此Rollbar会在发生历史回归时立即提醒您。
Rollbar supports:
Rollbar支持:
a wide range of languages and frameworks 多种语言和框架 all popular messaging systems 所有流行的消息传递系统 the most-used deployment platforms 最常用的部署平台 instant error reporting 即时错误报告 installation on your own premises 在自己的场所安装guaranteed privacy
保证隐私
Should you need more convincing…
如果您需要更令人信服的…
Rollbar can be integrated into your web, desktop or mobile application in minutes. It’ll be quicker than it took to read this article!
Rollbar可以在数分钟内集成到您的Web,桌面或移动应用程序中。 它比阅读本文要快!
I wish all documentation was as good as Rollbar’s! The guides are well-organized, concise and provide plenty of examples in all languages.
我希望所有文档都和Rollbar一样好! 指南井井有条,简洁明了,并提供了所有语言的大量示例。
The RESTful API guide is essential should you need to support another language or integrate your services with Rollbar.
如果您需要支持另一种语言或将服务与Rollbar集成,则RESTful API指南至关重要。
The Rollbar dashboard offers quick searching options but, if that’s not enough, you can use the new Rollbar Query Language (RQL) — an SQL-like syntax for running queries on your Rollbar data.
Rollbar仪表板提供快速搜索选项,但如果还不够,您可以使用新的Rollbar查询语言(RQL) —一种类似于SQL的语法,用于在Rollbar数据上运行查询。
Errors are reported from your production systems, which may (or should) be hosting minified versions of your client-side JavaScript files. Minification can rename function names and renumber lines. Rollbar allows you to upload associated JavaScript source maps which ensures messages are identified with the original, uncompressed source code.
错误是从生产系统报告的,生产系统可能(或应该)托管客户端JavaScript文件的缩小版本。 缩小可以重命名函数名称并重新编号行。 使用Rollbar,您可以上传关联的JavaScript源映射 ,以确保使用未经压缩的原始源代码标识消息。
Rollbar is free for personal projects and prototypes. Pricing is based on the number of events raised per month — regardless of team size. Adding another collaborator costs nothing.
Rollbar对于个人项目和原型是免费的。 定价基于每月引发的事件数 - 与团队规模无关 。 添加另一个协作者不会花费任何费用。
The average Rollbar team has 30 developers but the system can scale to projects of unlimited sizes.
Rollbar团队平均每个团队有30个开发人员,但是系统可以扩展到无限大小的项目。
The biggest benefit: Rollbar saves considerable time. Team members have a central location which collates all reported errors and distributes tasks to whichever messaging and bug-tracking system they prefer.
最大的好处: Rollbar节省了大量时间 。 团队成员位于中心位置,可以整理所有报告的错误并将任务分配到他们喜欢的任何消息传递和错误跟踪系统。
Sign-up for Rollbar today — there’s a fully-featured, no-obligation 14-day trial period which requires no credit card or initial payment. You’ll soon wonder how you developed without Rollbar.
立即注册Rollbar-有功能齐全,无义务的14天试用期,无需信用卡或首次付款。 您很快就会想知道没有Rollbar怎么发展。
翻译自: https://www.sitepoint.com/how-to-improve-your-teams-debugging-times-with-rollbar/
相关资源:jdk-8u281-windows-x64.exe