0

I have FTP site. When I enter wrong UserName/Password, then I don't find any log in C:\inetpub\logs\LogFiles. I have checked, FTP logging, It's enabled and path is correct.

1
  • Your question is ambiguous: Is IIS logging not logging the UserName of FTP users or not logging at all?
    – user62491
    Jan 9, 2014 at 18:02

1 Answer 1

1

How long did you wait? IIS logs are not flushed to the disk instantly.

See: http://weblogs.asp.net/owscott/archive/2012/02/03/flush-http-and-ftp-logs-in-iis.aspx - unfortunatly flushing the FTP logs is not as straight forward as flushing HTTP logs:

Powershell:

Param($siteName = "Default Web Site") 

#Get MWA ServerManager
[System.Reflection.Assembly]::LoadFrom( "C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll" ) | Out-Null
$serverManager = new-object Microsoft.Web.Administration.ServerManager 

$config = $serverManager.GetApplicationHostConfiguration()

#Get Sites Collection
$sitesSection = $config.GetSection("system.applicationHost/sites")
$sitesCollection = $sitesSection.GetCollection() 

#Find Site
foreach ($item in $sitesCollection){ 

    if ($item.Attributes.Item("Name").Value -eq $siteName){
        $site = $item
    }
}
#Validation
if ($site -eq $null) { 
    Write-Host "Site '$siteName' not found"
    return
}

#Flush the Logs
$ftpServer = $site.ChildElements.Item("ftpServer")

if (!($ftpServer.ChildElements.Count)){
    Write-Host "Site '$siteName' does not have FTP bindings set"
    return
}

$ftpServer.Methods.Item("FlushLog").CreateInstance().Execute()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .