Monitoring Platform Events
By default, the EMP service logs each platform event received. Following is a typical log entry:
Received Event replayId: 74605910, Type: update_job,Id: a2F4a000001ZI9TEAW,CreatedDate: 2023-05-09T03:00:38.309Z,QType: transaction,QId: wo_and_event
* 
For production tenants deployed in cluster configurations, the EMP service runs on the job application. To perform the queue administration and management tasks in this topic, you must first access the job application.
To monitor platform events:
1. To enable the EMP service log, in Direct Execution, run the following Groovy code:
def logger = org.slf4j.LoggerFactory.getLogger(com.intalio.salesforce.emp.internal.EMPService)
logger.setLevel(ch.qos.logback.classic.Level.INFO)
When a platform event is received by Service Board, a log entry similar to the following is generated:
2019-08-29 10:49:41,134 ERROR [c.i.s.e.i.EMPService] [ HttpClient@3c3184fe-101] Receive event /event/SVMXC__SM_Service_Board__e with data {schema=EwD6zo2UkDG6FeQjGc2qZA, payload={CreatedById=0051U000003Wm3BQAS, CreatedDate=2019-08-29T02:49:39.572Z, SVMXC__SM_Event_Type__c=update_job, SVMXC__SM_Callback__c=false, SVMXC__SM_Batch_Delete__c=false, SVMXC__SM_Object_Name__c=SVMXC__Service_Order__c, SVMXC__SM_Payload__c={"payload":{"systemFields":{"LastModifiedById":"0051U000003Wm3BQAS","LastModifiedDate":"2019-08-29 02:49:35","CreatedById":"0051U000003Wm3BQAS","CreatedDate":"2019-08-20 08:25:52"},"objectName":"SVMXC__Service_Order__c","io_uuid":null,"fields":{"CurrencyIsoCode":"USD","SVMXC__Primary_Territory__c":null,"SVMXC__Order_Status__c":"Open","SVMXC__SM_Estimated_Duration__c":"120.00","SVMXC__SM_Version_Number__c":"1","SVMXC__SM_Multi_resource__c":"false","SVMXC__SM_Life_Cycle_Status__c":"DispatchedA","SVMXC__Zip__c":null,"SVMXC__Work_Order_Scheduling_Status__c":null,"SVMXC__Street__c":null,"SVMXC__State__c":null,"SVMXC__Skill_Set__c":null,"SVMXC__Site__c":null,"SVMXC__Service_Duration__c":"7200.00","SVMXC__Scheduled_Date_Time__c":"2019-08-29 00:00:00","SVMXC__Purpose_of_Visit__c":null,"SVMXC__Product__c":null,"SVMXC__Problem_Description__c":null,"SVMXC__Priority__c":"Low","SVMXC__Preferred_Start_Time__c":null,"SVMXC__Preferred_Technician__c":null,"SVMXC__Preferred_End_Time__c":null,"SVMXC__Order_Type__c":"Onsite Service","SVMXC__Longitude__c":null,"SVMXC__Latitude__c":null,"SVMXC__Group_Member__c":"a1a1U000000QsEuQAK","SVMXC__SM_Crew_Name__c":null,"SVMXC__SM_Crew_Id__c":null,"SVMXC__Country__c":null,"SVMXC__Contact__c":null,"SVMXC__Component__c":null,"SVMXC__Company__c":"0011U00000DPc6jQAD","SVMXC__City__c":null,"OwnerId":"0051U000003uxbFQAQ","Name":"WO-00010383","SVMXC__SM_Integration_Source__c":"Local","Id":"a1g1U000001Ywp1QAC"},"criteria":{"Id":"a1g1U000001Ywp1QAC"}},"eventName":"update_job"}}, event={replayId=390967}}....... <OTHER SIMILAR LOGS> ......2019-08-29 10:49:41,134 INFO [c.i.s.e.i.EMPService] [ pool-12-thread-1] start to process event with replay id >>>>> 390967 2019-08-29 10:49:43,786 INFO [c.i.s.e.i.EMPService] [ pool-12-thread-1] Completed to process event with replay id >>>>> 390967
* 
At the very end of the log entry shown above, 390967 is the event replayId, which you can use to identify a platform event.
2. To enable the log for SFDCSyncToDCOperation, in Direct Execution, run the following Groovy code:
def logger = org.slf4j.LoggerFactory.getLogger(com.servicemax.dc.operation.integration.SFDCSyncToDCOperation)
logger.setLevel(ch.qos.logback.classic.Level.INFO)
Log entries include the request URL and the response data for callback platform events. Successful requests return data similar to the following:
2019-08-29 10:49:43,786 Event: 631701 Request url: Select Id,OwnerId,Name,SVMXC__Company__c,SVMXC__Conta ....... Returns: ...<SFDC QUERY DATA>...
* 
In the log entry shown above, 631701 is the event replayId, which you can use to identify a platform event.
Exception Log Output
Exceptions and warnings that occur during platform event processing appear in the logs. Following are several examples of log entries for various issues.
For callback platform events, if REST queries fail, an HTTP Notification record is created to request data again from Salesforce, for example:
Failed to request data from SFDC with url ...<REST QUERY URL>..., will continue the process with http notification. ...<EXCEPTION INCLUDING RESPONSE>...
Various problems that occur while processing platform events are logged in the following generic format:
Failed to sync the emp event data ...<EVENT DATA>... ...<EXCEPTION FOR THE ACTUAL CAUSE>...
For more information:
Was this helpful?