Search Results write_profile




Overview

FND_CORE_LOG is the Oracle E-Business Suite diagnostic logging package in the APPS schema. It provides a centralized mechanism through which Oracle EBS forms, concurrent programs, and custom PL/SQL code write diagnostic messages to a server-side log file when the site profile option FND: Debug Log Enabled is set to a value that enables logging, and the profile option identified by PROFILE_TO_LOG is populated. Rather than scattering ad hoc file writes throughout the codebase, the package abstracts the underlying UTL_FILE calls behind a small, guarded interface, so that logging can be switched on or off centrally without changing the calling code.

The package is classified in ETRM as OTHER, reflecting its role as shared infrastructure rather than as a public business API. It is referenced by two other packages, indicating that it is itself a dependency of the diagnostic logging framework rather than an end-user entry point.

Key Procedures and Functions

  • ENABLED — returns a varchar2 indicating whether diagnostic logging is currently active for the session, based on the relevant profile option settings. Callers typically test this before building expensive log text.
  • IS_ENABLED — companion status check, also returning a varchar2 flag.
  • PROFILE_TO_LOG — returns the name of the profile option that governs the log destination.
  • WRITE — the principal entry point for writing a diagnostic record. It accepts the current API name plus the user, responsibility, application, organization, and server identifiers, and formats them into a consistent log line.
  • WRITE_PROFILE — logs a profile option name and value alongside session context.
  • WRITE_PROFILE_SAVE — writes both a profile name/value pair and, given the level name and level value identifiers, records the profile change being performed.
  • PUT_NAMES — writes contextual name information (user, responsibility, and related identifiers) to the log file for a supplied user and directory.
  • OPEN_FILE — opens the log file. It is declared with a pragma restrict_references clause, marking it as not to be trusted for pure read/write-no-database/read-no-database restrictions.
  • PUT, PUT_LINE (two overloads), NEW_LINE, and CLOSE_FILE — the low-level write primitives, mirroring the UTL_FILE vocabulary and equally pragma-restricted.

Tables Accessed

  • FND_PROFILE_OPTIONS — read to resolve the names and definitions of the profile options that control logging behavior.
  • FND_PROFILE_OPTION_VALUES — read to obtain the actual values set at site, application, responsibility, or user level, which determine whether logging is enabled and where output is directed.
  • DUAL — used for trivial scalar evaluation.
  • V$INSTANCE and V$PARAMETER — queried to derive server and instance identity for the LOG_SERVER_ID context, and to locate the UTL_FILE destination directory.
  • DBMS_UTILITY and UTL_FILE — not tables but referenced program units; UTL_FILE performs the physical file I/O, while DBMS_UTILITY supplies formatting and call-stack utilities.

Usage Notes

The package is normally invoked from within Oracle EBS API implementations that already follow the standard diagnostic-logging convention, and from custom PL/SQL that wishes to participate in the same log stream. Because logging depends on profile option values, behavior varies by site, application, responsibility, and user; a session in which logging is disabled will see the guard functions return false and no file output generated.

Regarding the searched term utl_file_error: the package declares a user-defined exception of that name and associates it with Oracle error number -20100 via PRAGMA EXCEPTION_INIT(UTL_FILE_ERROR, -20100). When the underlying UTL_FILE operations fail — for example, because the target directory is invalid, the file cannot be opened, or the directory object is inaccessible — the raised error is trapped as this exception. Custom code invoking the PUT, PUT_LINE, OPEN_FILE, or CLOSE_FILE routines should therefore include a handler for the UTL_FILE_ERROR exception raised by FND_CORE_LOG, or at least tolerate the -20100 error, which would otherwise surface to the calling form or concurrent program.