console.log(text) Last updated: 14. Aug 2026
API only function
Outputs specified text to the site's console log, same as in JavaScript. console.warn and console.error write the same way, but mark the line as a warning or an error.
Open the log with the Console button while browsing the folder in Docly, or read it from your own code with docly.getConsoleLog.
The log is kept in memory on the server, as a rolling buffer of the last 1000 lines per site. It is cleared when the application restarts or the app pool recycles, so use it for live debugging - write to a file with docly.saveFile if you need a log that survives a restart.
See also: getConsoleLog
Parameters
| Name | Type | Description |
|---|---|---|
| text | string | Text to write to log. Same behaviour as in JavaScript. |
Returns
Nothing, but writes text to log. Only works in API functions.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.console.log("Log information");
console.warn("Log a warning");
console.error("Log an error");
// Objects are written as JSON:
console.log({ user : "someone@example.com", items : 3 });
// The lines show up in the Console view for the folder,
// and can be read back with docly.getConsoleLog().
// * Only available in API functions.