Click here to Skip to main content
13,355,018 members (59,883 online)
Click here to Skip to main content
Add your own
alternative version


21 bookmarked
Posted 15 Jan 2004

The Pipe Design and Log4Net

, 15 Jan 2004
Rate this:
Please Sign up or sign in to vote.
From Designer's view to see the Pipe Architecture and apply with Log4Net


The goal of this article is not to show "how to", but from my point of view, one of the reasons why Log4Net looks this way.

After reading this, you could decide to build your own logging engine or to easily use this interesting Framework.

Background You Need

  • An idea about object-oriented programming
  • (Optional) Experience of Log4Net/Log4Net

The Log4Net

You could get this from It's an application framework, focus on the most common event logging service. It's from Java Group. and it's open source. Microsoft has the same Application Framework, try to do this too. It is called "Enterprise Instrumentation Framework (EIF)". When you build a house of application, in addition to the classical tiers solutions, there are some building blocks that can just fit in with any one of those.

For example, the security and the Management as below:

The Abstraction

Image the "sewage treatment". Everyone's house must has pipes, which at the end will be connected into one big "sewage factory". If you ever play the EA's game "SimCity™ 4" you should already know what I am talking about. So, what's interesting? From the above diagram, I had used fish and cancer to explain.

Component: It's your house.

Logger: It's the Pipe with controllable gate door.

Appender: It's the place your pipe will connect to the exact "sewage factory"

Filter: During the flow of pipe, you put kinds of Filter to allow only interesting subjects flow through.

Layout: Once you have got your interesting subject, you need to pack it into Repository Recognizable format.

Render: Finally, you have to physically translate it into the Repository.

We could also think of this in the CRC's way.

The Dynamic View

Our first diagram is another type of collaboration diagram. We could see this in sequence.

Inside the Logger object, when we push event into that Logger, some calculation would look like this:

Writing Motivation and Other Notes

This article is from my point of design view, and I have to say that the trigger for me to write this paper is Log4Net.

It doesn't means that I have read all the papers from them, or I have traced all the source code.

In fact, I had only read their document of Introduction from page 1 to 6, and I want to keep my mind in a creative mode, so I wrote this.

It means, in the real Log4Net project, it sure has more detail or events have a totally different design from what I had imagined.

Since it's a nice hint for me, and that's open source, here I am.


  • 2003/1/16 First made, please comment
  • 2003/1/17 Added "The Context" session
  • 2003/1/19 Refined the article's structure and content


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Polo Lee
Web Developer
Taiwan Taiwan
Major in Object Oriented and Software Engineering.

btw, I am from Taiwan.

You may also be interested in...

Comments and Discussions

Generalgood article Pin
Sheeba Gandhi19-Apr-04 0:59
memberSheeba Gandhi19-Apr-04 0:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180111.1 | Last Updated 16 Jan 2004
Article Copyright 2004 by Polo Lee
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid