CFtpServer::GetLogFile Method  
 
BOOL GetLogFile(
  UINT * lpnLogFormat,  
  UINT * lpnLogLevel,  
  LPTSTR lpszFileName,  
  INT nMaxLength  
);
BOOL GetLogFile(
  UINT * lpnLogFormat,  
  UINT * lpnLogLevel,  
  CString& strFileName  
);
BOOL GetLogFile(
  CString& strFileName  
);

Return the current log file format and the full path to the file.

Parameters

lpnLogFormat
A pointer to an integer value that will contain the log file format being used when the method returns. If this information is not needed, this parameter may be NULL. The following formats are supported:
Constant Description
FTP_LOGFILE_NONE
(0)
This value specifies that the server should not create or update a log file.
FTP_LOGFILE_COMMON
(1)
This value specifies that the log file should use the common log format that records a subset of information in a fixed format. This log format usually only provides information about file transfers.
FTP_LOGFILE_EXTENDED
(2)
This value specifies that the log file should use the standard W3C extended log file format. This is an extensible format that can provide additional information about the client session.
lpnLogLevel
A pointer to an integer value that will contain the level of detail the server uses when generating the log file. The minimum value is 1 and the maximum value is 10. If this information is not needed, this parameter may be NULL.
lpszFileName
A pointer to a string buffer that will contain the full path to the log file. This parameter may be NULL if this information is not required. An alternate version of this method accepts a CString object if it is available.
nMaxLength
An integer that specifies the maximum number of characters that can be copied into the file name string, including the terminating null character. If the lpszFileName parameter is NULL, this value should be zero.

Return Value

An integer value which specifies the current log file format. Refer to the FTPSERVERCONFIG structure definition for a list of supported log file formats. If logging has not been enabled, this method will return a value of zero.

Remarks

If the server is configured with logging enabled, but a log file name is not explicitly provided, then the server will automatically generate one. This method can be used to get the full path to the current log file along with the format that is being used to record client session data. Normally the log file is held open by the server thread while it is active, however you can call the RenameServerLogFile method to explicitly rename or delete the log file.

To change the name of the log file, the log file format or level of detail, use the SetLogFile method.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csftsv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

RenameServerLogFile, SetLogFile