Operations | Monitoring | ITSM | DevOps | Cloud

elmah.io

Testing logging code with Microsoft.Extensions.Logging and FakeLogger

Unit testing is most often used for testing business logic. But what if you want to ensure that your code logs important messages to your log store? In this post, I'll introduce you to FakeLogger and how it can be used to test logging code when using Microsoft.Extensions.Logging and the ILogger interface. So, let's start by discussing why to even unit-test logging code. Adding good logging to your code is an often forgotten or down-prioritized practice.

"Secret" elmah.io features #1 - Include source code in errors

This is a new series of blog posts that I have been wanting to write for a while. elmah.io offers a large range of features both through the UI and the list of integrations. While basic error monitoring is used by all of our users, there are features available that can provide huge value but are not so commonly used or known. In this first part, I'll go through including source code in errors and how it will make it easier to debug errors.

Validate NuGet packages before publishing from GitHub Actions

A big part of elmah.io is our clients for various web and logging frameworks. All of them are open-source, hosted on GitHub, and available as NuGet packages on nuget.org. I have blogged about building on GitHub Actions in the past. It struck me that I have never actually shared anything about the various steps we take for validating NuGet packages before pushing them. Let's fix that!

Validate JSON files against schema in Azure DevOps build

JSON files have become part of our daily lives. We use JSON files for all sorts of tasks like settings, defining database schemas, and much more. The other day I found out that invalid JSON files had been pushed to one of our repositories. So, I decided to include JSON file validation as part of our build on Azure DevOps. In this post, I'll share the solution. I'm sure you can think of a scenario where invalid JSON files either do not parse as valid syntax or don't conform to the intended format.

Setting up better logging in Azure Functions

We have been using Azure Functions for years. Being able to easily deploy and run code on both Azure App Services and real serverless has been a killer feature for all of our asynchronous jobs and services. Unfortunately, the logging approach provided as part of the default template is not ideal. In this post, I'll introduce you to the first steps we take in all of our existing and new function apps to improve logging. A quick note about the Azure Functions runtime.

Parsing websites in C# with Html Agility Pack or AngleSharp

While developing the "new" canonical check feature for elmah.io Uptime Monitoring, I had to parse a website from C# and inspect the DOM. I have been using Html Agility Pack in the past so this was an obvious choice. I also looked at what happened in the space and found that AngleSharp is an excellent alternative. In this blog post, I'll showcase both frameworks to help you get started.

Building and deploying AWS email templates with Azure DevOps

This is the third and final post (for now) in the series about developing email templates with MJML and deploying them to AWS. In the previous post, we developed a Gulp script to automatically build HTML from the MJML file and insert it in a template file for AWS. In this post, we will set up an automated build and deployment of the email template using Azure DevOps. A quick recap.

Building MJML email templates with Gulp

This is the second post in the series about building email templates with MJML and deploying them on AWS. In the previous post, we learned about MJML and Handlebars.js for creating cross-browser email templates with dynamic content. In this post, I will show you how you can script the building process of MJML emails and prepare them for upload on AWS. Let's do a quick recap. In the previous post, I created a simple mail template in MJML.

Creating AWS email templates with Handlebars.js and MJML

In the next two posts (maybe more) I'll share how we have developed elmah.io's email templates currently sent out using Amazon Web Services (AWS). This first post will introduce template development using MJML and Handlebars.js. In the next post, I'll explain the process of building them on Azure DevOps and deploying them to AWS.