Data Extensions can store up to 4,000 characters in a single column. This method allows you to store debug logs even when they exceed 4,000 characters by splitting the error messages into 4,000-character segments across multiple records.
1. Create a Data Extension to store debug logs from Contact Builder or Email Studio.
DEBUG_LOG here)date, Data Type: text, Length: 30message, Data Type: text, Length: 4000symbol, Data Type: text, Length: 1002. Open the Data Extension you just created and make a note of its External Key value.
3. Create your SSJS script and publish it.
<script runat="server">
Platform.Load("Core","1");
var logDe = DataExtension.Init("YOUR_DATA_EXTENSION_EXTERNAL_KEY_FROM STEP 2");
var msg = "";
var part = "";
var logMessage = "";
try{
// Your own process goes here
} catch (error) {
msg = error;
while (msg.length > 0){
part = msg.substring(0, 4000);
logMessage = { date:Now(), message:part, symbol: "EASY_TO_IDENTIFY_MARKER_FOR_YOURSELF"};
logDe.Rows.Add(logMessage);
msg = msg.replace(part,"");
}
}
</script>
4. Refer to the DEBUG_LOG Data Extension to check for errors. Note: The date is stored in U.S. CST (Central Standard Time), which is 15 hours behind Japan Standard Time (JST), not Japan time.
000389966

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.