Welcome to the next installment in our blog series highlighting the companies in SoftLayer’s new Technology Partners Marketplace. These Partners have built their businesses on the SoftLayer Platform, and we’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.
- Paul Ford, SoftLayer VP of Community Development
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 http://papertrailapp.com/.
Receive DB Slow Query Logs in Your Inbox
Want to wake up to important database and syslog messages with your bagel and coffee? Here’s how. It’s free and takes about 5 minutes.
Most of us run a database somewhere on our SoftLayer servers. Whether it’s MySQL, PostgreSQL, SQL Server, or another relational or NoSQL sibling, a responsive data store is critical to happy users. That’s why databases send slow queries to a log file. It’s much better than no logging at all, but as an engineer, I’d wanted more. I wanted to:
- View all my query logs in one place, without SSHing to each server for tail and grep. My workload shouldn’t scale linearly as I add systems
- Share log visibility with employees who don’t have server access or command-line knowledge (and email links to specific log messages to my developers and DBAs)
- Receive log messages in my inbox – or send them to my team or monitoring service – when I know they need attention
- Examine logs for related HTTP requests, daemon output, API invocations, and other parts of our stack — I can troubleshoot faster with start-to-finish logs on a single screen.
That’s where Papertrail was born. We built Papertrail to make log aggregation and log management effortless and usable. It’s the hosted log management service that we wanted as developers, systems engineers and tech entrepreneurs.
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 – or any other logs – to your inbox every morning for free:
1. Register a Papertrail log Repository
Hit https://papertrailapp.com/plans and sign up. You’ll land on a welcome page. From there, click the “Add System” link, and on the form shown, type the IP of your DB server and its name (like “db1″).
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’s slow query log.
2. Send MySQL logs
Install 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 Ruby you can run the “gem” binary: sudo gem install remote_syslog
Next, locate your MySQL or other database slow query log file. Usually these are in the directory /var/mysql/log/
or /var/log/mysql/
, usually with a filename containing “slow”. An example slow query log path is: /var/log/mysql/mysql-slow.log
If you don’t see one, try running “locate mysql | grep slow.log
” (or to configure a slow query log, head here).
Next, tell remote_syslog the path to that file. Edit /etc/log_files.yml
and add a single line:
files: [/var/log/mysql/mysql-slow.log]
Use the path to your slow query log (Example). Finally, run remote_syslog:
sudo remote_syslog
3. Set up Nightly Email
Now that you’ve completed those first two steps, you’re configured to send those slow query logs to Papertrail as soon as they happen. Hit Papertrail’s events viewer to watch them roll in. Because only slow queries are being logged, you may not see any events immediately.
To receive these messages in email, search Papertrail’s events viewer for ‘mysql’. Then click “Save Search” and give this search a name (like “MySQL slow queries”). Click the Dashboard link and you’ll see that search as a new choice. Click the Edit link next to it, and you’ll be prompted for the email address(es) which should receive these in email every night.
That’s it. Congrats! If you were hoping for more steps, I’d recommend that you get yourself a Doppelbock or porter as Step 4.
You have the ability to give co-workers access to these logs in Papertrail, and because Papertrail doesn’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 “Add System” or “Quick Start”).
Enjoy!
- Troy Davis, Papertrail
- Lilah Brown's Planets, Part II (or, Season II preview) - November 8th, 2009 [November 8th, 2009]
- Snow White needs a bailout - November 8th, 2009 [November 8th, 2009]
- To the moon - November 8th, 2009 [November 8th, 2009]
- S/1 90482 (2005) needs your help - November 8th, 2009 [November 8th, 2009]
- We'll always have Regulus - November 8th, 2009 [November 8th, 2009]
- Orcus Porcus - November 8th, 2009 [November 8th, 2009]
- Kant's Crowded Universe - November 8th, 2009 [November 8th, 2009]
- Look up! - November 8th, 2009 [November 8th, 2009]
- Baby Pictures - November 8th, 2009 [November 8th, 2009]
- Encore: Yelping at Saints - November 8th, 2009 [November 8th, 2009]
- Godspeed - November 8th, 2009 [November 8th, 2009]
- Heavens above! - November 8th, 2009 [November 8th, 2009]
- Homeward bound - November 8th, 2009 [November 8th, 2009]
- Sony Pictures and the end of the world - November 8th, 2009 [November 8th, 2009]
- Thank you from the future - November 8th, 2009 [November 8th, 2009]
- Lunar dreams - November 8th, 2009 [November 8th, 2009]
- The first of the Pluto books! - November 8th, 2009 [November 8th, 2009]
- Don't try to blame it on Rio - November 8th, 2009 [November 8th, 2009]
- Rio roundup - November 8th, 2009 [November 8th, 2009]
- The long road to a Titan storm - November 8th, 2009 [November 8th, 2009]
- Planetary Placemats - November 8th, 2009 [November 8th, 2009]
- Fog! Titan! Titan Fog! (and a peer review experiment) - November 8th, 2009 [November 8th, 2009]
- Millard Canyon Memories - November 8th, 2009 [November 8th, 2009]
- The problem with science - November 8th, 2009 [November 8th, 2009]
- P.S. on the problem with science - November 8th, 2009 [November 8th, 2009]
- How Big is 10 TB? - November 8th, 2009 [November 8th, 2009]
- Showing You Your Servers - November 8th, 2009 [November 8th, 2009]
- Pick Your Partnership: Referral Partners, Resellers and Affiliates - November 8th, 2009 [November 8th, 2009]
- Server Form Factors: Towers v. Rack-Mounts - November 8th, 2009 [November 8th, 2009]
- Lights-Out in the Data Centers - November 8th, 2009 [November 8th, 2009]
- Disruptive Technologies: Virtualization and The Cloud - November 8th, 2009 [November 8th, 2009]
- Know Thy Backups – Part I - November 8th, 2009 [November 8th, 2009]
- Know Thy Backups – Part II - November 8th, 2009 [November 8th, 2009]
- Boo Bash 2009 – Desktop Costume Included! - November 8th, 2009 [November 8th, 2009]
- Why No One Will Talk About “Cloud Computing” in 10 Years - November 8th, 2009 [November 8th, 2009]
- The end of the fall - December 13th, 2009 [December 13th, 2009]
- We Love ‘Server Huggers’ - December 13th, 2009 [December 13th, 2009]
- All About the Cloud: An Interview with Dell’s Cloud Evangelist - December 13th, 2009 [December 13th, 2009]
- Happy Solstice - December 21st, 2009 [December 21st, 2009]
- A ghost of Christmas past - December 31st, 2009 [December 31st, 2009]
- Learning from a Blender - January 5th, 2010 [January 5th, 2010]
- Changing my world - January 6th, 2010 [January 6th, 2010]
- A Server. From Scratch. - January 7th, 2010 [January 7th, 2010]
- The Planet Sand Castle: Upgrade Your Sandbox - January 12th, 2010 [January 12th, 2010]
- Hosting for Haiti - January 20th, 2010 [January 20th, 2010]
- Redefining Value - January 26th, 2010 [January 26th, 2010]
- My Experience as a Newbie at The Planet - January 28th, 2010 [January 28th, 2010]
- Confessions of Another New Planeteer - February 1st, 2010 [February 1st, 2010]
- How I Learned to Stop Worrying and Love Permissions - February 11th, 2010 [February 11th, 2010]
- Where at The Planet is Rachel? - February 15th, 2010 [February 15th, 2010]
- The Planet Storage Cloud: FYI - February 19th, 2010 [February 19th, 2010]
- Meet us in March - February 25th, 2010 [February 25th, 2010]
- The Planet in “The Channel” - March 2nd, 2010 [March 2nd, 2010]
- The Planet Server Challenge - March 13th, 2010 [March 13th, 2010]
- The Definitive Guide to Finding The Planet at SXSW - March 13th, 2010 [March 13th, 2010]
- The SXSW Iron Geek Champion! - March 15th, 2010 [March 15th, 2010]
- Drinking from the Fire Hose - March 16th, 2010 [March 16th, 2010]
- The Fastest Hands at SXSW - March 17th, 2010 [March 17th, 2010]
- System.out.println(“Hello World!”); - March 22nd, 2010 [March 22nd, 2010]
- Westmere – Get it Here - March 23rd, 2010 [March 23rd, 2010]
- Orbit on Your iPhone: A Sign of Things to Come - March 24th, 2010 [March 24th, 2010]
- #ShowMeMyServer 2.0 - March 25th, 2010 [March 25th, 2010]
- Get to Know Your Visitors - March 30th, 2010 [March 30th, 2010]
- The Next Big Thing in Hosting: The Hostatulator - April 1st, 2010 [April 1st, 2010]
- Storage Cloud and the City - April 4th, 2010 [April 4th, 2010]
- American Heart – Why I Walk - April 7th, 2010 [April 7th, 2010]
- The Cake Shouldn’t Be a Lie - April 8th, 2010 [April 8th, 2010]
- April Showers Bring May Flowers - April 9th, 2010 [April 9th, 2010]
- First at The Planet: Nehalem EX 4-Socket Servers - April 15th, 2010 [April 15th, 2010]
- Intel Guest Blog: Xeon 5600 - April 16th, 2010 [April 16th, 2010]
- Inside the Office: A Birthday Surprise - April 18th, 2010 [April 18th, 2010]
- The Planet @ Cloud Expo East - April 19th, 2010 [April 19th, 2010]
- The Planet @ ad:tech SF - April 22nd, 2010 [April 22nd, 2010]
- ad:tech Server Challenge - April 22nd, 2010 [April 22nd, 2010]
- ad:tech Panel: Developing Communities Online - April 23rd, 2010 [April 23rd, 2010]
- The Planet @ Interop Las Vegas - April 27th, 2010 [April 27th, 2010]
- Overflowing With Value: 10TB is Back! - April 28th, 2010 [April 28th, 2010]
- The Cloud is NOT the Revolution - April 29th, 2010 [April 29th, 2010]
- The Importance of Orbit 2.0 - May 5th, 2010 [May 5th, 2010]
- The Planet @ Web 2.0 Expo - May 6th, 2010 [May 6th, 2010]