{"id":37457,"date":"2011-07-24T15:45:00","date_gmt":"2011-07-24T15:45:00","guid":{"rendered":"http:\/\/euvolution.com\/futurist-transhuman-news-blog\/technology-partner-spotlight-papertrail\/"},"modified":"2011-07-24T15:45:00","modified_gmt":"2011-07-24T15:45:00","slug":"technology-partner-spotlight-papertrail","status":"publish","type":"post","link":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/planetology\/technology-partner-spotlight-papertrail.php","title":{"rendered":"Technology Partner Spotlight: Papertrail"},"content":{"rendered":"<p><em>Welcome to the next installment in our blog series highlighting the companies in SoftLayer&#8217;s new <a href=\"http:\/\/www.softlayer.com\/marketplace\">Technology Partners Marketplace<\/a>. These Partners have built their businesses on the SoftLayer Platform, and we&#8217;re excited for them to tell their stories. New Partners will be added to the Marketplace each month, so stay tuned for many more come.<\/em><br \/><span><strong>- Paul Ford, SoftLayer VP of Community Development<\/strong><\/span><\/p>\n<div>&nbsp;<\/div>\n<div><\/div>\n<p><em>Scroll down to read the guest blog from Troy Davis of Papertrail, a SoftLayer Tech Marketplace Partner that helps customers detect, resolve and avoid infrastructure problems using log messages. To learn more about Papertrail, visit <a href=\"http:\/\/papertrailapp.com\/\">http:\/\/papertrailapp.com\/<\/a>.<\/em><\/p>\n<h3>Receive DB Slow Query Logs in Your Inbox<\/h3>\n<p>Want to wake up to important database and syslog messages with your bagel and coffee? Here&#8217;s how. It&#8217;s free and takes about 5 minutes.<\/p>\n<p>Most of us run a database somewhere on our SoftLayer servers. Whether it&#8217;s MySQL, PostgreSQL, SQL Server, or another relational or NoSQL sibling, a responsive data store is critical to happy users. That&#8217;s why databases send slow queries to a log file. It&#8217;s much better than no logging at all, but as an engineer, I&#8217;d wanted more. I wanted to:<\/p>\n<ul>\n<li>View all my query logs in one place, without SSHing to each server for tail and grep. My workload shouldn&#8217;t scale linearly as I add systems<\/li>\n<li>Share log visibility with employees who don&#8217;t have server access or command-line knowledge (and email links to specific log messages to my developers and DBAs)<\/li>\n<li>Receive log messages in my inbox &ndash; or send them to my team or monitoring service &ndash; when I know they need attention<\/li>\n<li>Examine logs for related HTTP requests, daemon output, API invocations, and other parts of our stack &mdash; I can troubleshoot faster with start-to-finish logs on a single screen.<\/li>\n<\/ul>\n<p>That&#8217;s where <a href=\"http:\/\/papertrailapp.com\">Papertrail<\/a> was born. We built Papertrail to make log aggregation and log management effortless and usable. It&#8217;s the hosted log management service that <em>we<\/em> wanted as developers, systems engineers and tech entrepreneurs.<\/p>\n<p>We know the hesitation you might have when approaching this kind of service, so our goal was to enable users to have Papertrail deliver those SQL slow query logs &ndash; or any other logs &ndash; to your inbox every morning for free:<\/p>\n<p><span><\/span><\/p>\n<p><strong>1. Register a Papertrail log Repository<\/strong><br \/>\nHit <a href=\"https:\/\/papertrailapp.com\/plans\">https:\/\/papertrailapp.com\/plans<\/a> and sign up. You&#8217;ll land on a welcome page. From there, click the &#8220;Add System&#8221; link, and on the form shown, type the IP of your DB server and its name (like &#8220;db1&#8243;).<\/p>\n<p>Papertrail will display a remote syslog destination for your logs and easy instructions for sending app log files and syslog. The steps below are customized for MySQL&#8217;s slow query log.<\/p>\n<p><strong>2. Send MySQL logs<\/strong><br \/>\nInstall a log sender. To install a tiny standalone binary that sends log file contents to Papertrail as they occur without any other system-wide configuration changes, with <a href=\"http:\/\/www.ruby-lang.org\/en\/downloads\/\">Ruby<\/a> you can run the &#8220;gem&#8221; binary: <code>sudo gem install remote_syslog<\/code><\/p>\n<p>Next, locate your MySQL or other database slow query log file. Usually these are in the directory <code>\/var\/mysql\/log\/<\/code> or <code>\/var\/log\/mysql\/<\/code>, usually with a filename containing &#8220;slow&#8221;. An example slow query log path is: <code>\/var\/log\/mysql\/mysql-slow.log<\/code><\/p>\n<p>If you don&#8217;t see one, try running &#8220;<code>locate mysql | grep slow.log<\/code>&#8221; (or to configure a slow query log, head <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/slow-query-log.html\">here<\/a>).<\/p>\n<p>Next, tell remote_syslog the path to that file. Edit <code>\/etc\/log_files.yml<\/code> and add a single line:<br \/>\n<code>files: [\/var\/log\/mysql\/mysql-slow.log]<\/code><\/p>\n<p>Use the path to your slow query log (<a href=\"https:\/\/github.com\/papertrail\/remote_syslog\/blob\/master\/examples\/log_files.yml.example\">Example<\/a>). Finally, run remote_syslog:<br \/>\n<code>sudo remote_syslog<\/code><\/p>\n<p><strong>3. Set up Nightly Email<\/strong><br \/>\nNow that you&#8217;ve completed those first two steps, you&#8217;re configured to send those slow query logs to Papertrail as soon as they happen. Hit Papertrail&#8217;s <a href=\"https:\/\/papertrailapp.com\/events\">events viewer<\/a> to watch them roll in. Because only slow queries are being logged, you may not see any events immediately. <\/p>\n<p>To receive these messages in email, search Papertrail&#8217;s events viewer for &#8216;mysql&#8217;. Then click &#8220;Save Search&#8221; and give this search a name (like &#8220;MySQL slow queries&#8221;). Click the Dashboard link and you&#8217;ll see that search as a new choice. Click the Edit link next to it, and you&#8217;ll be prompted for the email address(es) which should receive these in email every night.<\/p>\n<p>That&#8217;s it. Congrats! If you were hoping for more steps, I&#8217;d recommend that you get yourself a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Bock#Doppelbock\">Doppelbock<\/a> or porter as Step 4.<\/p>\n<p>You have the ability to give co-workers access to these logs in Papertrail, and because Papertrail doesn&#8217;t charge a per-system fee, you can add other systems at will. With your SQL logs done, it only takes a few more minutes to aggregate Web server request logs and OS syslog results from your dedicated and CloudLayer systems (try &#8220;Add System&#8221; or &#8220;Quick Start&#8221;). <\/p>\n<p>Enjoy!<\/p>\n<p>- Troy Davis, <a href=\"http:\/\/papertrailapp.com\">Papertrail<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to the next installment in our blog series highlighting the companies in SoftLayer&#8217;s new Technology Partners Marketplace. These Partners have built their businesses on the SoftLayer Platform, and we&#8217;re excited for them to tell their stories. New Partners will &hellip; <a href=\"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/planetology\/technology-partner-spotlight-papertrail.php\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"limit_modified_date":"","last_modified_date":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-37457","post","type-post","status-publish","format-standard","hentry","category-planetology"],"modified_by":null,"_links":{"self":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/37457"}],"collection":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/comments?post=37457"}],"version-history":[{"count":0,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/37457\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/media?parent=37457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/categories?post=37457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/tags?post=37457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}