Tag Archives: log4net

How to remove warning: The ‘log4net’ element is not declared

So I’ve seen a lot of questions around this issue with generally the only resolution being: “It’s a warning, just ignore this”. Whilst it is safe to do this, for pedants like me there is a true resolution. There are a few places around the net to get this but (like a lot of issues I blog about) you often need to combine the advice. Here’s the true resolution:

Continue reading How to remove warning: The ‘log4net’ element is not declared

Colour your Log4Net events in your RichTextBox

You’re most probably here because you have already read my article How to watch your log through your application in Log4Net and you’re thinking “that’s great, but I need to somehow differentiate all of this output!” – either that or you just really need a handy way to format certain keywords within your RichTextBox.

Continue reading Colour your Log4Net events in your RichTextBox

How to watch your log through your application in Log4Net

Log4Net is an excellent logging system that allows you to clearly see what your application is doing and when, making it very easy to debug your app during development but especially during production. I have previously demonstrated how to use Log4Net in C# which enables you to log output to your console for the former and to a file for the latter, but recently I had a requirement to also log to screen during production. This is how I achieved it:

Continue reading How to watch your log through your application in Log4Net