log

The log built-in module is available to use in your EdgeWorkers code bundles to log messages generated during the current request.

You need to enable enhanced debug headers to view the logging results from the log module.

Logging only occurs once you've requested logging information using Enable enhanced debug headers. For more information refer to the JavaScript logging section.

import { logger } from 'log'; // Import the logger module
export function onClientRequest (request) {
  logger.log('Hello'); // Call the log method from the logger module
}

Did this page help you?