FileLogger Class
Represents a logger that logs events and errors to a local file.
Inheritance Hierarchy
SystemObject
  GroupDocs.Search.CommonFileLogger

Namespace: GroupDocs.Search.Common
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 20.8
Syntax
public class FileLogger : ILogger

The FileLogger type exposes the following members.

Constructors
  NameDescription
Public methodFileLogger
Initializes a new instance of the FileLogger class.
Properties
  NameDescription
Public propertyFilePath
Gets the log file path.
Public propertyMaxSize
Gets the maximum size of log file in megabytes.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodError
Logs an error that occurred in the index.
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Public methodTrace
Logs an event that occurred in the index.
Remarks
Learn more
Examples
The example demonstrates a typical usage of the class.
C#
string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";
string query = "Einstein";
string logPath = @"c:\Log.txt";

IndexSettings settings = new IndexSettings();
settings.Logger = new FileLogger(logPath, 4.0); // Specifying the path to the log file and a maximum length of 4 MB

Index index = new Index(indexFolder, settings); // Creating an index in the specified folder

index.Add(documentsFolder); // Indexing documents from the specified folder

SearchResult result = index.Search(query); // Search in index
See Also