Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Service Activity Log

Status
Not open for further replies.

blondebier

Programmer
Jun 19, 2003
142
GB
Hi Everyone,

I have a .net webservice which takes requests as a string of XML. It does some processing and returns a response. (Nothing fancy there.)

I have written a function to keep a log of all web service activity so I can keep track of everything that happens in case an exception or error was thrown.

This is an example of my Activity Log.

06/04/2006 14:38:55 LIVE: Start CheckAddress WebMethod ************************************************************************************
06/04/2006 14:38:55 LIVE: XML Recieved to CheckAddress
06/04/2006 14:38:55 LIVE: <?xml version="1.0" encoding="utf-8"?><CheckAddress><ClientID>username</ClientID><ClientPWD>secret</ClientPWD><Address><HouseNumber>1</HouseNumber><Street>Toy Street</Street><District /><Town>Toy Town</Town><County>My County</County><Postcode>PC1 1CD</Postcode><AtAddressFrom>01/01/2003</AtAddressFrom><AtAddressTo>01/01/2006</AtAddressTo><AddressType>U</AddressType></Address></CheckAddress>
06/04/2006 14:38:56 LIVE: UserID: 1
06/04/2006 14:38:57 LIVE: Validating the address...
06/04/2006 14:38:57 LIVE: Validation complete. Final XML response...
06/04/2006 14:38:57 LIVE: <?xml version="1.0" encoding="UTF-8"?><Result>AddressOK</Result>
06/04/2006 14:38:57 LIVE: End CheckAddress WebMethod **********************************************************************************

My problem is that if two requests were received by my web service at the same time or very close together, the Activity log entries get mixed up and I can't see what is going on.

Has anyone had this problem before and found a solution?

I'd appreciate any help.
Cheers,
Francis
 
Yes. It took 6 months of arguement with my boss that the logging system was unexceptable. Same type of thing, multiple users and a single text based log file.

Finally I got the green light for the logging system. I created a database system to handle it (we already had an administrative database in SQL Server, so I just had to add a app log table)

The log is specificly designed to track sessions and processes so that if a user started a session (started an application) and some process of the application fail, but the application survived, we could track the difference. It works similarly from the web interfaces as well.

At the most basic level, it just takes the info from the exception or log request and sticks it in a database instead of a text file. It also grabs the user name, the time, a coded enumeration, and an 'automated' flag. The functionality for session tracking and what not uses some return values from the stored procedures.

The greatest thing is that now, instead of spending an hour each morning parsing a jumbled text log trying to ensure the automated processes worked correctly, I can jump to the web based log viewer and see all of my automated processes start and finish times, and exception info if there was any. And I can jump to each process and application log to see the play by play logging. And I can pull up logs for specific users, which is extremely handy when debuging a user issue.

Sweet jebus I love the data/web base logging.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Or you could just make a class logging with an arraylist of entries, make it serializable and then make an arraylist or some other collection and use a reader that will serialize this to a binairy file wich you can then deserialize easily and it will give you the same structure.

Christiaan Baes
Belgium

"My new site" - Me
 
Thanks Guys.

I think the serialize/deserialize option sounds more what I'm looking for.

I don't suppose you know of anywhere I might find an example...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top