Showing all posts tagged: 'logging'

A 7-post collection

Visual Studio Code integration with Azure Application Insights

I don't know how I've missed this but today I found out that Visual Studio Code (VS Code) provides excellent integration with Application Insights (AI). If you're not using AI for monitoring your apps (any app, any code) then you're missing out big time. Regardless of whether you're running on the cloud or on-premises, AI can light up your application in many interesting ways and give you a unique insight on areas such as: Exceptions Events User actions Custom events and metrics Dependency mapping Analytics Proactive improvements with AI and Machine Learning I believe that a separate blog post is …[read more]


Azure Functions custom logging with AppInsights

You can tell I'm working on Azure Functions from the frequency of posts. This one focuses on logging. Functions by default generate plenty of logs which you can view in the portal or download using the Kudu REST API. This is great and it comes out of the box without you having to configure a single thing. However, what if you have some custom, complex logic that you want to capture and log. And I guess that in most instances there will be more than one Function per AppService and potentially a lot more applications and services deployed on Azure. …[read more]


Application logging to Azure using SeriLog

I'm in the process of creating a cloud-based application that needs to scale well and I'm thinking about error management and logging. There will be a follow up post about the application itself, but for now I want to focus on the logging bit. In my quest to find the right tool, I remembered reading about Serilog some time ago. I've been meaning to try Serilog but I had to find the right project/opportunity. And now I finally got it! The thing I like about Serilog is that it’s extremely easy to set up especially with its fluent …[read more]


Logging with AngularJs - extending the built-in logger

AngularJs has an impressive and robust logging mechanism through the $logService and $log injection. However, Angular logs everything to the console, which is neither a robust or scalable solution. Sometimes, you need to be able to intercept the exceptions and do something extra. This could be as simple as adding extra information or sending all logs to the server/database. Below I've included two different ways that you can achieve that. Option 1 The first one is pretty simple and allows you to hook into the $exceptionHandler and pass a logger in the form of an AngularJs factory. The factory …[read more]


Application Logging with LibLog

I have blogged about application logging in .NET a few times, here and here. It seems that every iteration gets better than the one before - the logging frameworks, not my posts :) Logging has always been important but for some odd reason it is either too complicated to implement or too clunky. In the beginning, we had strongly coupled implementation using one of the established logging frameworks (log4net, nLog etc). Then we learned from our mistakes and moved on to the Common.Logging API which abstracted things quite a bit and made logging more accessible. The goal behind this evolution …[read more]


Extend the Common.Logging API with Log4Net

In an earlier post I described how the Common.Logging API can help us abstract logging in our application by hiding the implementation details and allowing us to use different logging providers (NLog, Log4Net etc) in a modular, plug-n-play way. In this post, we will examine how to combine Common.Logging with Log4Net in order to output log messages to a file. 1. Install the right NuGet packages in the right order Before beginning, I will assume that all your assemblies already implement the Common.Logging API. If not, then go through my post to see how to add logging …[read more]