|
|
Entries for the 'Programming Tips' Category
Today I have released the Log4Net Dashboard SDK, the SDK will enable users of L4NDash to extend the dashboard, using the SDK L4NDash can be extended in two areas:
You can write your own data providers, this will enable the L4NDash application to use log rows/log events from almost any kind of log storage and in any kind of format.
You can write your own visualizers, visualizers is responsible for formatting/preparing a single column value before it is rendered on into a web page. For...
[Read the rest of this article...]
In a windows form I needed to detect if the tab key was pressed, but Tab keys are “eaten” by windows, creating a KeyPress event on the textbox won’t do it.
But I fond the ProcessCmdKey you can put on the form, the code below did it:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if(textBox1.Focused == true) // do the textbox have focus?
{
const int WM_KEYDOWN = 0x100;
const int WM_SYSKEYDOWN = 0x104;
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_...
[Read the rest of this article...]
I needed to be able to change the file log4net was logging on programmatically, on the same time I wanted to use the other configuration options available in the config file.
After several different approaches I ended up with writing a method like the one listed below:
static bool ChangeLogFileName(string AppenderName, string NewFilename)
{
log4net.Repository.ILoggerRepository RootRep;
RootRep = log4net.LogManager.GetRepository();
foreach (log4net.Appender.IAppender iApp in RootRep...
[Read the rest of this article...]
Lately I have worked with web services and XML, and I used the xsd.exe tool that is a part of .NET framework (and Visual Studio) to generate source code for serializing and desterilizing of XML files. Xsd.exe is an excellent XML Schema Definition tool, it generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly.
Like I said, an excellent tool, but I must say that I am quiet feed up with switching to a command prompt every time...
[Read the rest of this article...]
One of the more exotic and advanced features of Log4net is lossy logging.
Actually the idea behind it is simply great, it supports the typical production scenario of: As long as everything is working, I don’t want my log filled up with debug (or info) messages, but when an error occurs, I would like to have all the messages that leads to this error situation.
And that’s what lossy logging is all about!
Implementing lossy logging is done through configuration, and as al...
[Read the rest of this article...]
Let me start by saying, I am a strong believer in strong typing. From my point of view, typless collections (for example) have nothing to do with object oriented programming! One of my basic programming philosophies is: let the compiler catch as many errors as possible. Having this attitude, the generics in C# 2.0, is for me a major milestone.
Due to this, and on earlier experience with other programming languages, I was really looking forward C# 2.0 with generics.
My fir...
[Read the rest of this article...]
Finally Log4Net Dashboard is up and running on ASP.NET 2.0!
I did come across a couple of problems.
Delegates:
I hade some delegates methods. In ASP.NET 1.0 I had the delegate definition in the same source file where I did the actually implementing of the method, which worked well inn ASP.NET 1.0. But when I compiled the project in 2.0 I got the error message:
error CS0246: The type or namespace name 'ShowErrorMessageHandler' could not be found (are you missing a using directive or a...
[Read the rest of this article...]
The work on Log4Net Dashboard is progressing. I had a long sidestep into CSS. I wanted to make the user interface customizable through use of CSS. A lot of work to put all the pieces together, put I finally found out that I needed one style sheet witch is common and one style sheet the user could choose. I finally grasped the meaning of cascading – never actually given it much of a tough.
In the user chosen style sheet I’d put all the colors and font stuff which defines the...
[Read the rest of this article...]
|