Showing posts with label logging. Show all posts
Showing posts with label logging. Show all posts
Monday, June 4, 2012
Centralized Logging with Codeigniter
Background
In a previous article I spoke about the search for a logging system. Having decided on Loggly, I needed a way to integrate logging in both my API and application.
Setup
All of my servers needed to be set up to pass syslog messages onto Loggly. I was using Ubuntu and there was an easy walk through on the Loggly wiki here. I grouped all of my servers in the "Production" group so that all logs were searchable under one group. I could have separated the groups (or inputs as Loggly calls them) into an "Application" and "API" group but thought that combining them together would help me search for issues more efficiently.
After the initial setup, I found that cron messages were immediately filling up my logs with unnecessary information. Messages similar to the one below were common.
pam_unix(cron:session): session opened for user root by (uid=0)
I wanted to remove those messages from Loggly. I had to go into /etc/syslog-ng/syslog-ng.conf and edit the filters to ignore cron messages.
log {
source(s_all);filter(f_cron); destination(d_loggly);
};
Saturday, March 17, 2012
Find a great logging system
I wanted to get more detailed logging and have it available to my team and I so I can do postmortem analyzing of transactions after they were completed. This could help me discover what data was actually sent by the user, what the SQL query was (if any), the resource requested, and what the status code returned was. I needed this both for my web app code as well as for my API, and I needed to be able to search through both of them to find specific transactions.
First step was to choose a logging platform. I had several criteria that I used while evaluating each logging product.
1. Ease of Install
2. Ease of Maintenance
3. Low cost of entry
4. Great Search functionality
5. API to pull out data from.
I would like to stress here that I am in no way a sysadmin and only know enough to be dangerous! I narrowed my choices to 2, Splunk and Loggly. Here is what I found:
First step was to choose a logging platform. I had several criteria that I used while evaluating each logging product.
1. Ease of Install
2. Ease of Maintenance
3. Low cost of entry
4. Great Search functionality
5. API to pull out data from.
I would like to stress here that I am in no way a sysadmin and only know enough to be dangerous! I narrowed my choices to 2, Splunk and Loggly. Here is what I found:
Subscribe to:
Posts (Atom)