473,383 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Whats the better way of Trace/Log into a text file.

RK
Our Application solution consists Web Service and 3 other C# class
libraries.
We added Trace Listener to the application and writing log information
in all our components.

Since multiple sessions access the same application, log messages are
interspersed and looks clumsy. And more its hard keep maintaining the
log, as components calls among themselves multiple times.

what is the better way of maintaining session level log writing to
tracelistener all at once. I am thinking of having Session level
StringBuilder Object and appending all the log and writing all at once
to tracelistener. Is anybody can suggest me what are the tradeoffs
involved in it?

thanks in advance.
--RK
Jul 21 '05 #1
1 1774
There is none =) The problem is not so much identifying which message is
coming from where (you could use a GUID associated to a process ID or app
domain) but the fact that you're dealing with a flat text file. Unless you
use some other media (like a database) you'll have to come up with a way to
sort or organize the text output. XML might come in handy here - you could
use a simple stylesheet to filter and sort entries, for example.
--

Klaus H. Probst, MVP
http://www.vbbox.com/
"RK" <r_***********@yahoo.com> wrote in message
news:1d**************************@posting.google.c om...
Our Application solution consists Web Service and 3 other C# class
libraries.
We added Trace Listener to the application and writing log information
in all our components.

Since multiple sessions access the same application, log messages are
interspersed and looks clumsy. And more its hard keep maintaining the
log, as components calls among themselves multiple times.

what is the better way of maintaining session level log writing to
tracelistener all at once. I am thinking of having Session level
StringBuilder Object and appending all the log and writing all at once
to tracelistener. Is anybody can suggest me what are the tradeoffs
involved in it?

thanks in advance.
--RK

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: IK | last post by:
Hi all, How can I save trace output to the text file in app's dir. In addition, I need to save debug info from Session_End event in global.asax. The code below saves file only in...
1
by: RK | last post by:
Our Application solution consists Web Service and 3 other C# class libraries. We added Trace Listener to the application and writing log information in all our components. Since multiple...
15
by: d4 | last post by:
I have a vbscript (below) I want to rewrite in C# but I cannot get it to work (unless there is a better way to do it). The script will combine 2 lines if the (next) line contains a "+",...
9
by: andy.z | last post by:
If 2 people try to access the same text file at the same time to write to it - what happens in PHP ? What I mean is - presumably the first will be ok - But what will the second person actually...
0
by: Grant Schenck | last post by:
I have an ASP application which uses a COM object I developed. That object uses OutputDebugString as well as writing to a text file to trace internal activity. If I test my ASP page from Visual...
4
by: engggirl3000 | last post by:
I was told to write a function that will read data, in a user defined text file, into a vector of structs. I am not sure where to start with this. Could some one tell me what is a vector of...
13
by: sugard | last post by:
Abstract Class, Inheritance, Polymorphism, File Handling, Exception Handing A program is to be devised for a university to work out whether or not, a student or a professor, is outstanding. The...
6
by: =?Utf-8?B?emFsZHk=?= | last post by:
Hi! I have a question.. How can csharp read a text file and execute it in another application? What I mean is that, Im doing a drawing using Tekla Structures. But instead of doing the same...
1
risk32
by: risk32 | last post by:
Hello. I'm trying to open a file for comparison to two (2) input box text values. ie: txtPassword.text + ";" + txtUsername.text must equal whats in a line in the UNPW (username password) text file...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.