Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow batch or queuable jobs to create a single log with a series of log entries #499

Open
stephenpstanley opened this issue May 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@stephenpstanley
Copy link

New Feature Summary

Currently the facility exists to link logs together using a call to Logger.getTransactionId() but all this does is populate a lookup field on every successive log record to the initial log record.

Batch Apex is intended for large volumes of records and the system generates N+2 Log records where N is the number of batches processed so when processing large numbers of batches you get lots of Log records. Tracing progress of the entire batch execution requires inspection of every log record and each log record's child log entries in turn.

Diagnosing issues with batch execution would be much easier if it was possible to have a single log record and for every logger.info/warn/error call create a child log entry record under that single log record

@stephenpstanley stephenpstanley added the enhancement New feature or request label May 26, 2023
@jongpie
Copy link
Owner

jongpie commented Jun 8, 2023

Hi @stephenpstanley - I love the idea of having a way to more easily see all log entries generated by a batchable or queueable job, but I don't think I want to do it by creating a single Log__c. The goal of Log__c is to represent a single Apex transaction, so having a single Log__c record that represents multiple transactions (from the batchable or queueable job) breaks some design & reporting concepts. I'll try prototyping some ideas to see if there other possible solutions that would still provide easy access to all logging data for a specific job.

@stephenpstanley
Copy link
Author

Understood. I've got a bit of a workaround using a custom report that groups by the parent log ID, but it's not ideal as it's hard to use from mobile. Problems that need to be analysed tend to crop up in the evenings when I'd rather look at it without having to fire up my laptop!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants