Search Results set_log_level




Overview

FND_OAM_DEBUG is a diagnostic and logging utility package supplied by Oracle Applications in the APPS schema. Its purpose is to provide a lightweight, self-contained logging framework that other EBS PL/SQL components can call to emit debug and trace information during execution. Rather than each product team building its own tracing mechanism, FND_OAM_DEBUG centralizes the behavior: it allows a developer to initialize a logging session, direct output to one or more destinations, write timestamped and indented log lines, and then flush or close the session cleanly. The package is declared with AUTHID CURRENT_USER, meaning that its SQL statements execute under the privileges of the calling user rather than the definer, an important consideration when invoking it from custom code.

The package defines three style constants — STYLE_SCREEN, STYLE_FILE, and STYLE_FND_LOG — that map logging output to different devices. This design lets a developer toggle the same instrumented code path between interactive screen output, an operating-system file, and the standard Oracle EBS logging repository without changing the surrounding code.

Key Procedures and Functions

The documented API comprises thirteen procedures and functions. The core logging lifecycle is managed by the following:

  • INIT_LOG — Initializes the package log-related state. It controls whether timestamps preface each line, whether indentation is applied, and the starting indent level. It should be called before any log statements or ENABLE_STYLE_* calls.
  • FLUSH_LOG — Flushes all enabled log styles, ensuring buffered output is written to the active destinations. This is the routine surfaced by searches for flush_log.
  • CLOSE_LOG — Closes all log styles and resets package state to defaults, releasing file handles and terminating the logging session.

Destination control is provided by ENABLE_STYLE_SCREEN (routing output through DBMS_OUTPUT), ENABLE_STYLE_FILE (writing to a file in the database Oracle Home, with an optional filename prefix and unique suffix), and ENABLE_STYLE_FND_LOG (routing to the FND logging facility). The DISABLE_STYLE procedure turns a given style off.

Log content is emitted through LOG, with LOGSTAMP available for stamped output. Contextual controls include SET_LOG_LEVEL for threshold filtering and SET_INDENT_LEVEL for nesting depth. A TEST procedure is also exposed, likely for self-diagnostic or smoke-testing purposes.

Tables Accessed

The package references a small set of objects through APPS synonyms: DBMS_OUTPUT, DUAL, UTL_FILE, and V$PARAMETER. DBMS_OUTPUT supplies the screen-output channel; UTL_FILE provides file I/O for STYLE_FILE; DUAL supports trivial expression evaluation; and V$PARAMETER is consulted to resolve database instance parameters, most plausibly the utl_file_dir or user-dump-directory settings that govern where log files may legally be written. No application tables are read or written, confirming that FND_OAM_DEBUG is purely an infrastructure utility with no transactional footprint.

Usage Notes

FND_OAM_DEBUG is referenced by approximately twenty other packages, indicating broad reuse across Oracle Applications modules. It is typically invoked from custom PL/SQL, concurrent program logic, and other instrumented packages rather than from end-user Forms directly. The canonical invocation sequence is INIT_LOG, one or more ENABLE_STYLE_* calls, repeated LOG calls, then FLUSH_LOG and CLOSE_LOG. Because the package honors CURRENT_USER privileges, custom code must ensure the invoking schema can access DBMS_OUTPUT and UTL_FILE. Output routed to STYLE_FND_LOG integrates with the standard EBS FND logging diagnostics, while STYLE_FILE output is constrained by database directory security.