Showing all posts tagged: 'logging'

A 9-post collection

Working with Application Insights and NLog in Console apps (.NET)

[Application Insights](https://azure.microsoft.com/en-us/services/application-insights/" target="_blank) is a logging platform that allows the collection and, more importantly, the collation of log data from any application. It's primarily optimised and designed to work with web frameworks such as Node.js, ASP.NET (Core too) or PHP etc. You choose the language and AppInsight's got you covered. There are, however cases that you want to do some logging (and you should) from a different type of application, like an Azure WebJob or a Console App. AppInsights works flawlessly with web frameworks because under the hood …[read more]


Query Profiling on Azure SQL

[Azure SQL](https://azure.microsoft.com/en-us/services/sql-database/?v=16.50" target="_blank) is one of the most valuable Platform as a Service (PaaS) offerings on Azure, second only to Web Apps. It's incredibly cost effective and fully featured. It supports a number of database versions and can be deployed in seconds. The other day I was looking to test something with EF Core and I needed a database to run queries against. I went to the Azure portal, I created a database with prepopulated data using the AdventureWorks (Datawarehouse Workload - DW) and I was ready …[read more]


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](https://code.visualstudio.com/" target="_blank) (VS Code) provides excellent integration with [Application Insights (AI)](https://azure.microsoft.com/en-us/services/application-insights/" target="_blank). 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 …[read more]


Azure Functions custom logging with AppInsights

You can tell I'm working on [Azure Functions](https://azure.microsoft.com/en-us/services/functions/" target="_blank) 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](https://github.com/projectkudu/kudu/wiki/REST-API" target="_blank). 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 …[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](https://github.com/serilog/serilog" target="_blank) 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 …[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]