Writing a Custom Appender for log4net

On most of my projects, I use log4net (a habit I carried over from Java really) to maintain traces and logs. I find it preferable to using the trace mechanism, and it certainly beats Console.Write as a technique. One of the best things about it is that you can configure appenders to write to pretty much anything. The appenders that come bundled with log4net cover most of the stuff you’d actually want to log to – the event logs, console, a database, file system, and so on. However, sometimes you may need something a little more specific.

In my case, I needed to have one of my projects log issues directly into the issue tracking system we use here. Said tracking system exposes a web service to do just that, so I set about writing an appender that would consume this service. I’m not going to go into the details of how to connect to this specific system, but hopefully this short post will illustrate how incredibly easy it is to write a custom appender. Continue reading “Writing a Custom Appender for log4net”

LuaInterface

While having a beer with an old friend yesterday, we started discussing the use of scripting languages in applications. Having seen a number of .net applications with embedded Lua scripting engines, I suggested that he look at LuaInterface, with the disclaimer that I hadn’t used it much myself.

Having nothing better to do this afternoon, I decided to download the whole thing again (the last version I’d downloaded had languishing in my download folder for about 10 months, and was probably out of date, if I could find it in the first place) and have a go at it. Attached are the results of my messing around. It’s by no means a best practice guide – or even a good practice guide, for that matter – but it looks like it’s working. Continue reading “LuaInterface”

Directory Services and Asp.Net 2.0 Authentication

Yes, yes… .Net 2 is so last season. Even so, I’ve noticed that a lot of coders, especially those who haven’t played with it in depth, are still missing out on some of the excellent components that come bundled with it. Case in point are the authentication tools. Setting them up couldn’t be much easier – just write up the settings in your web.config file and plonk the authentication control on your page.

In an attempt to reduce the number of home-made authentication systems I keep seeing – some of them quite good, I must admit – below is a (very) short guide to configure a web application to authenticate users against a Directory Service such as Active Directory or LDAP. Continue reading “Directory Services and Asp.Net 2.0 Authentication”