EventLogFile
Represents event log files generated by Event Monitoring. Use event log file data to analyze usage trends and user behavior in your Salesforce org. This object is available in API version 32.0 and later. The Interval and Sequence fields are available only in API version 37.0 and later.
You can interact with event monitoring data by querying fields on the EventLogFile object (like EventType and LogDate). CreatedDate tracks when the log file was generated. To view the underlying event data, query the LogFile field. The EventType determines the schema of this field. Log files don’t count towards your org’s data or file storage allocations. For more information, see EventLogFile Supported Event Types.
Composite requests that include multiple API requests in a single call aren’t supported. In the event of a composite request, EventLogFile captures only the parent request.
For details about event monitoring, see the Trailhead Event Monitoring module.
Log data schema for each EventType can change. With each new release, use the LogFileFieldNames and LogFileFieldTypes fields to validate the schema changes. In the unlikely case in which no log files are generated for 24 hours, contact Salesforce Customer Support.
Debug and troubleshoot performance issues by correlating logs using the customizable Request Identifier field, available in all Event Monitoring logs. To correlate logs pertaining to an API request call, set the X-SFDC-REQUEST-ID header with a 32 character OTEL compatible TraceId or a 22 -character alphanumeric Id. Using SOQL, search for the Event Monitoring logs with this RequestId to correlate the logs and see the unit of work performed as a part of the API transaction.
Introduced in API version 29.0.
- Accessing this object requires View Event Log Files and API Enabled user permissions. Users with View All Data permission can view event log files.
describeSObjects(), query(), retrieve()
- Type: double
- Properties: Filter, Sort
- Introduced: API version 30.0
- Description: The specific API version for this log file.
- Type: picklist
- Properties: Filter, Group, Restricted picklist, Sort
- Description: The event type—API, Login, Report, URI, and so forth. Use to determine which files were generated for your org. For the corresponding
LogFileschema, see EventLogFile Supported Event Types.
- Type: picklist
- Properties: Filter, Group, Nillable, Restricted picklist, Sort
- Introduced: API version 37.0
-
Type: datetime
-
Properties: Filter, Sort
-
Description: The date and time of the log file’s creation. For daily event log files, tracks usage activity for a 24-hour period, from 12:00 a.m. to 11:59 p.m. UTC time. For hourly event log files, indicates the hour in which the log file was generated. For example, for events that occur between 11:00 AM and 12:00 PM on 3/7/2016, this field’s value is 2016-03-07T11:00:00.000Z.
For hourly event log files, we recommend using
CreatedDateto query the date and time that an EventLogFile object was created.
- Type: base64
- Description: Encoded file data in
.csvformat. TheEventTypefield defines the schema for this data.
- Type: int
- Properties: Filter, Group, Sort
- Type: string
- Properties: Filter, Group, Sort
- Description: The content type of the log file; always
.csv.
-
Type: string
-
Properties: Nillable
-
Introduced: API version 32.0
-
Description: The ordered list of fields in the log file data.
LogFileFieldNamesandLogFileFieldTypesare specific to eachEventType. For example,LogFileFieldNameshas a different value for an APIEventTypeand a LoginEventType.
-
Type: string
-
Properties: Nillable
-
Introduced: API version 32.0
-
Description: The ordered list of field types in the log file data (
String,Id, and so forth).LogFileFieldNamesandLogFileFieldTypesare specific to eachEventType. For example,LogFileFieldTypeshas a different value for an APIEventTypeand a LoginEventType.
- Type: double
- Properties: Filter, Sort
- Description: The log file length in bytes. You can use this field to plan storage needs for your log files.
- Type: int
- Properties: Filter, Group, Sort
- Introduced: API version 37.0