Thursday, July 21, 2011

Pipeline Extensibility - Logging

The only current way to log information during the pipelining process is to write your file to the FAST service user's LocalLow directory.  I usually use this to debug what information is coming into the pipeline when I am transforming it. 

Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Xml.Linq
Imports System.Text
  
Namespace Search
    Class PipelineLogger
  
        Shared Sub Main(ByVal args As String())
  
'Log the input doc         
WriteOutInputFile(args(0), args(1))
  
        End Sub
  
        ' Write the input file to a location the application has access to write in.
        Private Shared Sub WriteOutInputFile(ByVal inputFile As String, ByVal username As String)
            
Dim localLow As String = "c:\users\" & username & "\appdata\LocalLow"
  
Dim pipelineInputData As String = IO.Path.Combine(localLow, "PipelineExtensibilityLog")
IO.Directory.CreateDirectory(pipelineInputData)           

Dim outFile As String = IO.Path.Combine(pipelineInputData, DateTime.Now.ToString("yyyyMMddHHmmss.ffff") & ".xml")
IO.File.Copy(inputFile, outFile)
            
Return
        End Sub
  
    End Class
End Namespace
Then in the %FASTSEARCH%\etc\pipelineextensibility.xml I input the fields that I wish to debug:
(MOSS2010.Search is the user running the FAST service)
<Run command="C:\FASTSearch\etc\PipelineLogger\PipelineLogger.exe %(input)s MOSS2010.Search >
    <Input>
        <CrawledProperty propertySet="d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1" varType="31" propertyName="VIEWS"/>
        <CrawledProperty propertySet="11280615-F653-448F-8ED8-2915008789F2" varType="31" propertyName="url"/>
    </Input>
    <Output>
    </Output>
</Run>

No comments:

Post a Comment