Tune logging levels in Production without recompiling code

IAP Software Development Practice JournalThis article first appeared in Software Development Practice, Issue 1, published by IAP (ISSN 2050-1455) 

Abstract

When raising log events in code it can be difficult to choose a severity level (such as Error, Warning, etc.) which will be appropriate for Production; moreover, the severity of an event type may need to be changed after the application has been deployed based on experience of running the application. Different environments (Development (Dev), User Acceptance Testing (UAT), Non-Functional Testing (NFT), Production, etc.) may also require different severity levels for testing purposes. We do not want to recompile an application just to change log severity levels; therefore, the severity level of all events should be configurable for each application or component, and be decoupled from event-raising code, allowing us to tune the severity without recompiling the code.

A simple way to achieve this power and flexibility is to define a set of known event IDs by using a sparse enumeration (enum in C#, Java, and C++), combined with event-ID-to-severity mappings contained in application configuration, allowing the event to be logged with the appropriate configured severity, and for the severity to be changed easily after deployment.

Continue reading Tune logging levels in Production without recompiling code

GOOS at 7digital – Code Shapes, the Purpose of Tests, and Logging Done Well

I recently went to a Devs in the ‘Ditch meetup at 7digital to hear Chris O’Dell (@ChrisAnnODell) explain 7digital’s journey to Continuous Delivery and Steve Freeman (@sf105) speak on GOOS and system testing. We had some useful discussions on dependency injection and how to use logging well, and Steve’s perspectives on ‘code shapes’ and the purpose of tests were revealing.

Continue reading GOOS at 7digital – Code Shapes, the Purpose of Tests, and Logging Done Well

Event-Sourced Architectures by Martin Thompson at QConLondon 2012

Software performance guru Martin Thompson (@mjpt777) gave an illuminating talk on event-sourced architectures, and why event-driven, state-machine designs are the way forward for complex, multi-path software systems (Event Sourced Architectures and what we have forgotten about High-Availability”, [slides: 700KB PDF]).

QConLondon 2012 blog posts
See all QConLondon 2012 blog posts…

Continue reading Event-Sourced Architectures by Martin Thompson at QConLondon 2012

Using LogParser and Log Replay to Bootstrap Load Test Scripts

In a previous post I mentioned how Microsoft LogParser can be used to discover HTTP endpoints in legacy applications. Another great use for LogParser is to generate files to drive load test scripts.

Loaded truck by jcurtis4082 (Flickr)

Continue reading Using LogParser and Log Replay to Bootstrap Load Test Scripts

Endpoint Discovery using Microsoft LogParser

A few years ago, I was working on a project for a UK client who needed to replace or rewrite a legacy inventory management  web application written in classic ASP. The problem: no documentation, and complicated, spaghetti source code with many apparently duplicate or redundant ASP files and ASMX web service endpoints.

Finger pointing by bhollar (Flickr)

Which ASP pages were actually in use? We had to find a way to limit our application migration efforts to  only those pages which were used by the application. A colleague at the time introduced me to what must be one of the best-kept secrets in the Windows developer world: Microsoft Log Parser.

Continue reading Endpoint Discovery using Microsoft LogParser