Every time I take on a new development, I consider generating traces a vital part, since it’s one of the mechanisms that will let us diagnose and identify any kind of problem once we’re in production, sometimes even before users get around to reporting it.
Making our application generate the right traces is a great tool, not only for diagnosing bugs; it also lets us identify performance problems and other kinds of abnormal behavior in our applications.
Over the last few years I’ve used NLog, the library from The Object Guy, homegrown solutions, and these last few months I’ve used Serilog in WPF, Web, and WinRT projects. But there’s always something that doesn’t quite convince me: the interfaces for exploring the logs. I’ve tried Windows applications like LogExpert, BareTail, Harvester, Tail for Win32, and more polished solutions like Splunk or LogEntries, but in the end none of them convinced me, either because of features or cost.
A few months ago I came across ExceptionLess and it seemed like a pretty interesting project. As a summary, these are some of the points I found interesting:
- I can use it as a service or set it up on my own infrastructure.
- It has PCL libraries with offline support. This means I can use it on the tablet and, when there’s no connection, it stores the logs locally to send them when the connection comes back.
- It supports notifications.
- I can attach complex objects to the traces, so I can check them when I look at the trace from the UI. Basically, if it can be serialized to Json, it can be attached.
- It tries to make it easier to identify problems/patterns by grouping traces or showing the most frequent ones.
- It’s Open Source. And I find this especially important because it lets me fix some of the minor shortcomings I’m finding (now I just need to learn Angular ;P).
And since not everything is good, I think it’s important to point out a few things I didn’t like while using it:
- The user interface is still a bit green. It has some interface details that are a bit disorienting. Silly things like hitting search not taking you to the list of search results if you’re on a log’s detail page. It just sets the filter as the active filter, but you have to go to the log list yourself to see them.
- It’s very much geared toward using it with their platform. You notice this a lot when setting it up on your own server, in details like the default settings pointing to their domain (exceptionless.io) or aspects of the server and client configuration being different.
Watch out if you want to set up ExceptionLess on your own server
It doesn’t make sense to write a tutorial on setting it up locally, because the instructions are on GitHub and they aren’t complicated. You only need MongoDB and ElasticSearch. If you set up several API servers you need Redis, but for a single node it isn’t needed and it uses an in-memory implementation.
Keep in mind that you need to install two projects, the API and the UI. For this example, let’s assume a local test setup with the API installed at: http://localhost/ExceptionLess.API
When installing the UI, you need to edit the app.config file to set the API url in the BASE_URL key. Well, although the first option seems to be setting the url to ‘http://localhost/ExceptionLess.API’, doing that won’t work. The correct url to configure is: ‘http://localhost/ExceptionLess.API/api/v2’
However, to send logs to that server from a .Net application, the url I have to configure is indeed ‘http://localhost/ExceptionLess.API’. This drove me a bit crazy at first.