Skip to content

Feature Request: Always store HTTP Request/Response regardless of log level #855

Answered by jongpie
jvega-intakedesk asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jvega-intakedesk - you should be able to do this already with any log entry, using one of the overloads for Logger.newEntry(). Essentially, you provide a boolean value to indicate if the log entry should be saved (regardless of the user's configured logging level).

Here's an example of how to use it:

// You can decide if the the log entry is always saved (by always setting it to true),
// or if you could use some custom logic to determine the boolean value.
Boolean shouldSave = true; 
Logger.newEntry(System.LoggingLevel.FINEST, 'Another Message', shouldSave)
    .setHttpRequestDetails(new System.HttpRequest());
Logger.saveLog();

Hope this helps, but let me know if you have any follow …

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@jvega-intakedesk
Comment options

Answer selected by jvega-intakedesk
Comment options

You must be logged in to vote
7 replies
@jongpie
Comment options

@jvega-intakedesk
Comment options

@jongpie
Comment options

@jongpie
Comment options

@jongpie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants