I can query debug logs via
ApexLog object with SOQL, but the result doesn't contain an actual message.
How can I access the message? Is it achievable with SOQL or some API?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Tooling API has support since v 28 to download the Raw Apex Log. See this for more info.
It is possible also with REST Api, using the following path:
"/services/data/v29.0/sobjects/ApexLog/" + logId + "/Body/"
The log Id must be known (could be fetched with simple SOQL) and only one log per request can be fetched.