Solved

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

Posted on 2004-04-15
3
428 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 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