Search Results debug_on




Overview

CSE_DEBUG_PUB is a public utility package in the Oracle E-Business Suite (12.1.1 and 12.2.2) that provides a controlled, runtime-configurable debugging and diagnostic logging facility for the CSE (Enterprise Asset / eAM) module. Its central purpose is to allow developers and support personnel to capture diagnostic messages to an operating-system file so that troubleshooting can be performed without modifying or redeploying application code. The package exposes a small public API for turning debugging on and off, selecting an output file, setting a verbosity level, and writing structured debug messages. A key characteristic of the package is that it uses Oracle's UTL_FILE built-in to write messages directly to a server-side file, and it guards all behavior behind a profile option so that logging can be enabled or disabled centrally rather than in code.

Key Procedures and Functions

The package exposes six documented program units, all of which are public and callable from other PL/SQL units.

  • SET_DEBUG_FILE — A function that establishes the target debug file. When no explicit file name is supplied, it derives a default file name based on the CSE prefix and the current system date. It also resolves the log directory, defaulting to the cse_debug_log_directory profile option value or /tmp when that profile is not set. It returns the fully qualified path of the file that will be used.
  • SET_DEBUG_LEVEL — A procedure that assigns the active verbosity threshold, distinguishing between a "basic" and a more "detailed" level. This allows callers to filter the volume of diagnostic output that is actually written.
  • DEBUG_ON — A procedure that activates debugging. It opens the debug file (creating the file handle via UTL_FILE) if one is not already open and sets the internal flag indicating that debugging is enabled.
  • DEBUG_OFF — A procedure that deactivates debugging and releases the open file handle.
  • ISDEBUGON — A function returning a Boolean value that reports the current debugging state, allowing calling code to test whether debug output is active.
  • ADD — The core logging procedure. It accepts a debug message together with a message level and writes the message to the file only when debugging is enabled and the message level meets the configured threshold. It opens and closes debugging as needed within the call so that logging is self-contained.

Tables Accessed

The package does not manipulate any application data tables. Its only documented data access is through the server-side file package UTL_FILE, referenced via its APPS synonym. UTL_FILE is used exclusively to open, write, flush, and close the debug log file. The remaining inputs to the package are profile option values — cse_debug_option and cse_debug_log_directory — which drive whether logging occurs and where the log is written.

Usage Notes

CSE_DEBUG_PUB is a foundational diagnostic utility rather than a business transaction API. It is referenced by 23 other CSE packages, indicating that debug logging is widely embedded across eAM processing code. The package is typically invoked either from server-side PL/SQL within CSE routines that wish to emit diagnostic messages, or interactively during a support or development session when a problem is being investigated. Because behavior is gated on the cse_debug_option profile, enabling diagnostics is a matter of setting that profile to Y and ensuring a writable log directory exists through cse_debug_log_directory. Administrators must also ensure the database server's UTL_FILE_DIR (or Oracle directory) parameter permits access to the chosen location. The package is not intended for end-user forms interaction and should be enabled only for active troubleshooting, as it writes unencrypted diagnostic output to the file system.