Which statement logs the HTTP status code to a debug-level custom log file?

A Digital Developer needs to add logging to the following code:

Which statement logs the HTTP status code to a debug-level custom log file?
A . logger.getLogger(‘profile’).debug("Error retrieving profile email, Status Code: ", http.statusCode);
B . logger.debug("Error retrieving profile email, Status Code: {0} was returned.", http.statusCode);
C . Logger.getLogger().debug("Error retrieving profile email, Status Code: {0} was returned.", http.statusCode);
D . Logger.getLogger(‘profile’).debug("Error retrieving profile email, Status Code: {0} was returned.", http.statusCode);

Answer: B

Subscribe
Notify of
guest
1 Comment
Inline Feedbacks
View all comments
Dev
Dev
3 years ago

The correct answer is D