?
Solved

Log Files

Posted on 2011-09-11
6
Medium Priority
?
412 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

800 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