From the Blogosphere
JSON Logging in Apache and Nginx with Logentries
We’ll discuss configuring Apache and Nginx both to send JSON formatted logs
By: Trevor Parsons
Aug. 15, 2014 01:42 PM
I'm often asked on calls with our customers what is the preferred format for log data being sent to Logentries. While we pride ourselves on being the Log Management tool that is easiest to setup and use, some very important advanced features of the platform are available for logs that are formatted into Key Value Pair (KVP) or JSON. Most applications and programing languages have the ability to change their logging format. With a little bit of work, you can unlock the full potential of our advancedsearch functions. Below we'll discuss configuring Apache and Nginx both to send JSONformatted logs and how to take advantage of the search functions, sharable dashboards, and reporting capabilities within the Logentries platform.
127.0.0.1 - - [11/Aug/2014:16:44:00 +0000] "GET / HTTP/1.0" 200 11783 "-" "ApacheBench/2.3"
This log entry definitely contains some very important information. But by spending only 5 minutes configuring Apache, the logging information will contain a lot more useful information.
Start out by editing the apache2.conf file for your site/server found in /etc/apache2. Add the following line of code to your LogFormat area (see screen shot below).
Once this is configured, you now need to edit the default.conf for each site within your Apache configuration. In this case, we want to change the log type of access.log to leapache. For instance:
Latest AJAXWorld RIA Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
SYS-CON Featured Whitepapers
Most Read This Week