Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2003, 12:14 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading Current IIS Log

Hi!
Is there a way to read current IIS Log? If I do it by openeing a stream I get an error that the file is already being used by another process.

Please advice.
Thanks in advance.
-uday
 
Old July 16th, 2003, 12:17 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

One thing you could try is to create a copy of the file and read that. That worked for me with some other application that locked the log files.

Alternatively, you could log to a database, like SQL Server instead of to a file. That makes it a lot easier to query real-time data. If you need some more info about that, let me know.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old July 16th, 2003, 12:30 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi! Thanks for the reply. Copying the file would not work for me as the file size could be very large. Please give me more info about logging to database.
Thanks.
-Uday.

 
Old July 16th, 2003, 12:52 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!
Meanwhile I happened to search for the database logging. I got the info on it by doing iis search. If there are known issues with it and solutions please advice me.
Thanks.
-Uday.

 
Old July 16th, 2003, 12:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Here's what you need to do:

1. Create a database table with the following code:
Code:
CREATE TABLE InternetLog
(
    ID int IDENTITY (1, 1) NOT NULL,
    ClientHost varchar(255), 
    UserName varchar(255),
    LogTime datetime, 
    Service varchar( 255), 
    Machine varchar( 255),
    ServerIP varchar( 50), 
    ProcessingTime int, 
    BytesRecvd int,
    BytesSent int, 
    ServiceStatus int, 
    Win32Status int,
    Operation varchar( 255), 
    Target varchar(255), 
    Parameters varchar(255) 
)
2. Create a DSN to your database using the ODBC Control Panel.

3. Open IIS, and then your website. On the Properties dialog for your site, choose ODBC Logging from the drop-down. On the ODBC Logging Properties dialog fill in the details for your DSN, Table name and the username / password combination that you need to log in to your database.

If you use SQL Server, I think you'll need to use SQL Security instead of Integrated Security, but I am not 100% sure about that.

HtH

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to log to server's event log LenexaKS Access VBA 4 March 11th, 2008 12:49 PM
Can't get Log to write the Log.txt file jnbutler BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 July 31st, 2007 04:04 AM
iis.msc equivalent in IIS for Win XP Pro? RealDHelix Classic ASP Basics 14 March 18th, 2007 08:28 PM
Reading current http url dynamically in php hi2php PHP How-To 1 November 1st, 2006 04:16 AM
AppException Class -Log Error to Event Log bekim BOOK: ASP.NET Website Programming Problem-Design-Solution 7 December 7th, 2004 01:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.