In order to add debug messages to APEX pages you can use the following syntax :
wwv_flow.debug('This is my debug message');
You can use PLSQL variables or APEX page items :
wwv_flow.debug('### The value of P1_TEST_ITEM is ' || :P1_TEST_ITEM);
The three ###s make the debug message stand out from the numerous other APEX messages.
You can even include HTML tags to make your debug messages stand out from the Oracle debug text :
wwv_flow.debug('<font color="red">P1_TEST_ITEM = ' || :P1_TEST_ITEM || '</font>');
In order to enable debug mode in APEX you can either use the developer toolbar at the bottom of the page or insert YES into the 5th URL position (see
APEX URL Construction)