Moving from Loggly to Application Insights

Bill de la Vega
Aug 8, 2017 · 4 min read

We were using Loggly as the log server for our project. It worked fine, but we wanted more. We recently switched to Application Insights. This post details the reasons for switching as well as first impressions.

Before getting into why we switched I want to say that Loggly is great. We used it for well over a year, because it was the best free log server we found. It got us through the initial development of SocialWeaver. As we approach release, we wanted to improve our data collection and analysis. AppInsights made it pretty easy.

Switching Factors

Our project is written in C#, runs in Service Fabric, and is hosted in Azure. So Microsoft’s AppInsights is the natural choice for telemetry in this environment. The value of that can’t be over estimated.

In addition to AppInsights being the ‘default approach’, we don’t need another account or another URL to bookmark. It’s visible within Azure, so it’s the same place we look at other aspects of the project. This is more of a nice-to-have feature, not a major factor in the decision.

We were using the free version of Loggly. The free version is basically a shared log server with a good search interface. Here’s the Search screen:

On August 30th we were getting an error repeating. We tagged the different environments (dev, stage, prod) and logged in JSON, so filtering worked well.

At this point you think I’m comparing apples and oranges — that the free Loggly and AppInsights (see prices here) solve different problems. It is true that the paid version of Loggly is a closer match to AppInsights. It adds alerts, log tailing, and other features depending on the version. But we didn’t need or want 2 logging systems — one for messages we compose and another with telemetry and performance metrics. When we looked at the paid version of Loggly, it seemed without digging in very much that it is not as complete as AppInsights.

AppInsights has multiple kinds of logging for different needs. There are 7 types: trace, request, page view, custom event, exception, dependency, and availability. These are visible as search filter tags in the Azure GUI. All the custom messages we are sending to NLog come through as trace type in AppInsights:

These different aspects seemed like overkill when I first saw them. But they allow AppInsights to tailor the analysis for the various kinds of logging. API performance can be analyzed with Request logging. Looking for issues, check the Exception logs, and so on. We aren’t using all of them.

A big reason people choose AppInsights is probably the telemetry. This wasn’t a big factor for us. We aren’t using it right now, but we just got started. Seems like it has more value when instrumenting the client, while we are just instrumenting the backend currently.

A feature that appealed to me was finding correlations in the data. I haven’t used this much, but it looks helpful for understanding issues. Some basic matching is done automatically. Here’s an example. The attributes that match were mostly undefined. This “problem” isn’t observable by users, but maybe we should set some more attributes:

As far as the set up, Loggly has lots of libraries for lots of languages and log formats. We needed two libraries to forward NLog messages to Loggly. So our code was full of calls to write log messages.

We also use two libraries with AppInsights. The main library from Microsoft is Microsoft.ApplicationInsights. We are also using ApplicationInsights.OwinExtensions, since our services are OWIN. This library works with the pipeline design of OWIN. It fits in nicely as a middleware component. So two lines of code adds tracing for all the services! Our thanks to Marcin Budny for developing it.

Conclusion

It may be unfair to compare such different services. The no cost version of Loggly is a great free logging server, while AppInsights is a paid telemetry service. Taking a broader view though, they both fill the same role — giving developers and operations people the ability to see how their application is doing. There’s nothing that AppInsights does that you couldn’t do with Loggly. It is just that AppInsights makes it easier (in some cases much easier) to collect and analyze the data.

Thanks to SocialWeaver

Bill de la Vega

Written by

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade