Use FND Logging. At back Oracles FND Logging uses self reliant transaction to insert records in a table of name fnd_log_messages.
For example:DECLARE
BEGIN
fnd_log.STRING(log_level => fnd_log.level_statement
,module => 'xxxx ' || 'pkg/procedurename '.
,message => 'your debug message here');
END ;
Three profile options effecting FND Logging are:FND: Debug Log Mode
FND: Debug Log Enabled
FND: Debug Log Module