ApexLog al = [SELECT Id, LogUserId, LogUser.Name, Request, Operation, Application, Status, StartTime, Location, LogLength FROM ApexLog LIMIT 1];
String logId = al.Id;
System.debug(logId);
// Set HTTPRequest Method
HttpRequest req = new HttpRequest();
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
req.setEndpoint(Url.getOrgDomainUrl().toExternalForm() + '/sobjects/ApexLog/' + logId + '/Body');
req.setMethod('GET');
// Web service call
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
Could someone tell why is this happening? Also the status code is 404