This function retrieves entries from the system log database and returns them as an array of LogEntry structures. This function provides filtering of the log entries by date, and the error code associated with the log entry.
Description: This is the starting date for the log entries that you want retrieved. If you do not care about a starting date, use Date.MinValue
Description: This is the ending (latest) date for the log entries that you want retrieved. If you do not care about an ending date, use Date.MaxValue
Description: This is the error code to select records with. Use a value of -1 (Or use ShowAllErrorCode) if you do not care to filter log entries using the Error Code value. Error codes are provided by the procedure that added the log entry - they are not standardized. Consult the author of 3rd party provided scripts and plug-ins to obtain a list of error codes that they may have used.
Description: When set to True, the ErrorCode parameter is ignored and all log entries that match the other filters are returned.
This example retrieves all log entries from a week ago to today, with an error code of 4166: