Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Log Files

Posted on 2011-09-11
6
Medium Priority
?
414 Views
Last Modified: 2012-05-12
I have a dedicated server at Fasthosts with a few web domains. Windows Server 2003

Each domain automatically collects log files of each visit.

I wondered if it is possible to dispense with these log files, they get very large and I do not use them.
Can anyone advise me on this please?

Thank you

John
0
Comment
Question by:johnhardy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:vaibhavjaiman
ID: 36518675
Hello,

You can rotate the logs file ,Here is an example of the code under the vb script.

************************************************************************************************
Option Explicit

Dim intDaysOld, strObjTopFolderPath, strLogFIleSuffix, ObjFS, ObjTopFolder
Dim ObjDomainFolder, ObjW3SvcFolder, ObjSubFolder, ObjLogFile, ObjFile,ObjDomainsubFolder,ObjDomainlogsFolder

intDaysOld   = 3
strObjTopFolderPath = "C:\HostingSpaces"
strLogFIleSuffix = ".log"

Set ObjFS = CreateObject("Scripting.FileSystemObject")
Set ObjTopFolder = ObjFS.GetFolder(strObjTopFolderPath)

For Each ObjDomainsubFolder in ObjTopFolder.SubFolders  

For Each ObjDomainFolder in ObjDomainsubFolder.SubFolders

For Each ObjDomainlogsFolder in ObjDomainFolder.SubFolders

 For Each ObjW3SvcFolder in ObjDomainlogsFolder.SubFolders



  Set ObjSubFolder = ObjFS.GetFolder(ObjW3SvcFolder)

   For each ObjLogFile in ObjSubFolder.files

    Set ObjFile = ObjFS.GetFile(ObjLogFile)
    If datediff("d",ObjFile.DateLastModified,Date()) > intDaysOld and lcase(right(ObjLogFile,4))=strLogFIleSuffix then
     '*****************************************************
     'DON'T UNCOMMENT THIS UNTIL YOU KNOW IT WORKS PROPERLY!!!
     'WScript.Echo("Will delete " & ObjSubFolder.name & "\" & ObjFile.name)
     ObjFile.Delete
     '*****************************************************
    End If
    Set ObjFile = nothing
   Next
  Set ObjSubFolder = nothing
 Next
Next
 Next
Next

Set ObjTopFolder = nothing
Set ObjFS = nothing
************************************************************************************************

http://forum.dotnetpanel.com/forums/t/2991.aspx
http://forum.dotnetpanel.com/forums/p/1239/21163.aspx
http://forums.webhostautomation.com/showthread.php?t=18656
0
 
LVL 26

Accepted Solution

by:
Leon Fester earned 2000 total points
ID: 36522118
Log files are only needed when you are troubleshooting a problem or if you are using the logs for traffic and/or site analysis.
Otherwise It's just a waste of space then if you're not using them.
In that case I would suggest switching off the logging.

In IIS, Under the "Web Sites" folder,
right-click on your website
Click Properties
deselect "Enable Logging"
Click OK

Repeat for all other websites.

The default location for IIS log files is c:\windows\system32\logfiles\W3SVC1.
It is good practise to move this location away from your C: Drive.
0
 

Author Closing Comment

by:johnhardy
ID: 36522466
Many thanks for the solution, regret I did not understand the previous solution.

Thanks

John
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 4

Expert Comment

by:vaibhavjaiman
ID: 36522535
What i mean is that you can remove the logs files based on the log file date history.

Suppose if you are placing your website contents under the path

c:\domains\yourdomains-name\log\your logs files here

You can simply use the above script to delete the files older than 3 days.

Hope it might help you ,
0
 

Author Comment

by:johnhardy
ID: 36523244
Thanks vaibhavjaiman
I understand now more fully but regret that you solution is too advanced for me.

Sorry

Regards

John
0
 
LVL 4

Expert Comment

by:vaibhavjaiman
ID: 36527496
No Problem,

Hope it will help you in future.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

618 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