We are delighted to announce we have now added Logentries support for Jelastic users. Logentries is a log management and intelligence service that allows you to better understand your log data, and ultimately your systems. With today’s applications producing anywhere from millions to billions of events per day, logs can not longer be managed from the command line and log management solutions are becoming a requirement for your operations toolkit.
We also are happy for the guys over at Logentries: they just finished a $1 Million fundraising round!
Like Jelastic, Logentries has been designed to be dead simple to use, and does not require deep system admin skills. That way its suitable for your support teams and business analysts but also power enough for developers and administrators. Logentries also provides all the typical log management features you expect such as search, visualisation, storage etc. but it also comes with built in log intelligence so that your applications will not fail silently. For example, with Logentries you can preconfigure alerts and tags such that important events are highlighted in your logs, and so that you get notified when they occur. That way, if something serious is going down in one of your applications, you will be notified immediately. Logentries even have a mobile app so you can be sure your systems are running smoothly no matter where you are!
Logging on Jelastic with Logentries
The Jelastic UI always gave you access to your different component log files, however now you can stream these logs into a Logentries account where you can take advantage of log visialisation, search, alerts etc. That way, you can quickly get notified if there are any issues in your systems, and figure out the root cause of any problems. You can also store all your Jelastic logs at Logentries for as long as you require, be that for support, business analytics, operations or development purposes.
We have also preconfigured ‘log intelligence’ for Jelastic environments. That mean’s Logentries will automatically format your logs, highlight any exceptions and in certain cases provide information about what these exceptions actually mean for Jelastic users.
Configuring Jelastic with Logentries
Configuring Logentries with Jelastic takes only a few minutes and we have put together a step by step guide on how to do this (www.logentries.com/doc/jelastic). In summary it involves the following steps:
- Create a target host in the Logentries UI for your logs
- Create a log file in the Logentries UI for each log file you want to collect log events from in Jelastic
- Downloand and configure the Logentries/Jelastic plugin
- Finally restart your servers and you are good to go. Your logs will appear in Logentries within a few seconds
What Jelastic logs should I be looking at and why?
There are lots of logs on Jelastic that you may be interested in looking at, however, it will depend on the environment you have configured. Jelastic allows you to launch a number of different web and application servers and each of these can produce different log files. Here is a short summary of the different server containers and related logs (note the logs in bold tend to be the important ones):
Tomcat uses a logging implementation called JULI internally (http://tomcat.apache.org/tomcat-6.0-doc/logging.html), which was developed to address some of the shortcomings of the standard logging library shipping with Java (java.util.logging).
Thus Tomcat’s logging capabilities are quite flexible and Tomcat can produce quite a number of log files. Where different events go, can depend on how you configure your logging.properties file and whether you decide to use a logging library or not. For example all stdout and stderr messages are sent to the catalina.out. However, in particular for production systems, its a good idea to use a logging library (e.g. Log4J) and to direct log events into application specific logs and not to simply use stdout and lump all log events into a single log file.
On first glance the tomcat logging.properties file can be a bit daunting… for anyone looking to quickly understand this I’d recommend running through the tutorial provided by apache (http://wiki.apache.org/tomcat/Logging_Tutorial) before jumping into the more fine grained details of tomcat logging (http://tomcat.apache.org/tomcat-6.0-doc/logging.html).
The following logs will be generated when you kick off an instance of Tomcat on Jelastic:
- manager: logs related to the manger application that ships with Tomcat
- localhost_access_log: Captures access request logs
- catalina.out: This file contains log events produced by the tomcat server itself, e.g. during startup, shutdown and any messages produced by the server as it runs and manages the lifecycle of your applications. This log will also cature any stdout and sterr messages from your applications and is often used during development to log errors to.
- host-manager: logs related to the host-manager application that ships with Tomcat
- localhost: Captures any events generated where <Host name=”localhost”>
Similar to Tomcat, Jetty can log via stderr or logging can be controlled using a logging library (slf4j). Slf4j can in fact log to any of the java logging libraries including commons logging, log4j, nlog4j and java logging. Check out the Jetty docs (http://docs.codehaus.org/display/JETTY/Jetty+Documentation) for more details on how to configure their logging infrastructure.
Launching an instance of Jetty on Jelastic will produce two logs from Jetty.
- request: contains any request logs
- stderrout: this is simlar to the catalina.out from Tomcat, insofar as, out of the box it will capture internal server log events, as well as anything sent to stdout and stderr.
With Glassfish 3, each server instance and the domain administration server has an individual server log file. Glassfish logs are covered in a lot of detail on their docs page (http://docs.oracle.com/cd/E18930_01/html/821-2416/abluk.html). Again, similar to Tomcat and Jetty you can make use of logging.properties files and logging libraries to manage logging across your applications. When you kick off Glassfish instances on Jelastic it’s worth keeping an eye on the following logs:
- server_domain: This file contains log events relating to domain administration information. Note on Jelastic this log can regularly produce the exception below – and which can be safely ignored on Jelastic. Note we are building Jelastic specific intelligence into Logentries to give details on errors that you need to look out for, or as is the case with the exception below, that you can safely ignore (stay tuned for this!).
[#|2012-07-10T18:29:36.885+0400|SEVERE|glassfish3.1.1|javax.org.glassfish.gms.org.glassfish.gms|_ThreadID=69;_ThreadName=Thread-3;|GMSAD1017: GMS failed to start. See stack trace for additional information.
com.sun.enterprise.ee.cms.core.GMSException: failed to join group gfcluster
- server_instance: This captures internal server activity as well as your appliction log events and is likely a log you will be interested in keeping an eye on.
Some Example Jelastic Use Cases
Automated alerting for serious errors:
? Nothing like null pointer exceptions in their Java apps. However, generally everyone likes to know about these if they are happening, as they can be pretty serious and can lead to fairly catestrophic events in your applications. A great use case for Logentries is to configure alerts for important exceptions such that you get sent an email (or a notification to your smart phone if you prefer) if you ever get serious exceptions. Outofmemory errors are another one you might want to know about, although with outofmemory errors by they time they happen it may be too late 🙁 Ideally if you can get notified on events that signal something more serious, you can react before something really critical happens.
Creating Alerts on Logentries
? Tagging Your Events:
Logentries also allows you to highlight events of interest in your logs. So if you’ve just been notified about an issue you can see it immediately in the log graph view, highlighted with a colored tag. Simply click on a tag to get a list of all such events in your logs. You can set up tags for system errors (e.g. exceptions, warnings, errors), or for business events (e.g. payments, signups, logins) or for whatever events are important for you.
? Finding and resolving problems: If a new issue raises its ugly head, you may not have a tag set up and it thus may not be highlighted in the log graphs. In this case you may need to start digging for the issue in the log data. If you know roughly when an issue occured you can zoom in on that point in the log graph. Simply select the timeframe in the graph you are interested in to get a more fine grained view, or point and click on a particular point in time in the log graph to get taken directly to that point in the log file.
If you know an issue is related to a particular user or IP address, for example, simply use the search bar to search for it. Anyone who can use google (yes thats you 😉 can use the search bar, just type in the string you are looking for and Logentries will search for it. For power users, the search bar will also handle regular expressions in case you need to dig for more complex patterns (www.logentries.com/doc/patterns). Once you find and issue dont forget to tag or alert for it so you don’t have to go digging for it the next time. In fact if you highlight the text in your logs Logentries provides a small pop-up menu for you to do this as soon as you find the problem.
Finally let us know what you think, and in particular if there are particular Jelastic events that you would like to see highlighted or that you would like to be alerted on out of the box, pleased shout!!