Solved

Is there any log component for C# which works like log4j in Java?

Posted on 2004-04-15
3
426 Views
Last Modified: 2010-04-15
Is there any component for C# which works like the log4j in Java?
It means I can use it to define the type of log information, such as Debug, Warning, Error, etc. And I also want to generate the log output into either window console, windows Form, or physical file.
Do anyone has any idea about it?

Thanks!
0
Comment
Question by:Justlogin
  • 2
3 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10838542
the object is called Trace (you provide TraceListeners)

default it will go to debug window ...

you can easily create your own tracelistener for file etc ..

I am quite sure you can find a File TraceListener on a google search.

0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 10839928
Actually the file trace listener comes ready with the .net framework. It is called TextWriterTraceListener.

Justlogin, you should read about trace listeners and trace switches. Then you can write your code in such a way, that you can later configure it by changing the config file of your application.

You can start your exploration from here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskCreatingInitializingTraceSwitches.asp
0
 
LVL 20

Accepted Solution

by:
TheAvenger earned 250 total points
ID: 10839937
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now