Fusion Blog

EBS Blog


Contact Us

  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
There was a time when every individual Oracle Applications module used its own debugging technique.

But this is changing now, thanks to FND Logging. I have been using FND Logging for over one year now, ever since 11.5.10 was released, hence I would like to share knowledge on this topic.

What is the use of FND Debug Log?
1. It helps you pinpoint the cause of error in standard Oracle Code, by making debug messages to appear in a centralized table named FND_LOG_MESSAGES.
2. You can design and build your custom extensions in a manner that can easily be debugged. This can be done by calling Oracle delivered API’s in your custom code.

Where is the debug message stored, once the logging is turned on?
Debug messages are stored in a table called FND_LOG_MESSAGES
A program written in any technology, either form, or report, or pl/sql or java concurrent program or OAF…all their debug messages will be stored in fnd_log_messages.
All debug messages spooled to fnd_log_messages

How to debug the issue being faced in Oracle Application?
Step 1 Set the following profile options at your user level(your fnd_user)
FND: Debug Log Level
Following possible values are available, but I suggest you set this to "Statement" level when debugging code.
   LEVEL_UNEXPECTED     : Internal Level Id is 6
   LEVEL_ERROR          : Internal Level Id is 5
   LEVEL_EXCEPTION      : Internal Level Id is 4
   LEVEL_EVENT          : Internal Level Id is 3
   LEVEL_PROCEDURE      : Internal Level Id is 2
   LEVEL_STATEMENT      : Internal Level Id is 1

FND: Debug Log Enabled
    Set this profile to Yes

FND: Debug Log Module
    Set this to %

Step 2
Login to the application and reproduce the problem.

Step 3  
FROM fnd_log_messages
WHERE user_id = 209122 /*your FND_USER user_id here*/
ORDER BY log_sequence DESC /*note the order by clause here*/

The result of this select statement will provide the list of all the debug messages, on top will appear the most recent debug messages..

Why should I setup the module name to %, in profile option?
You can set this to po%, if you know for sure that the error was caused by code written in po module. However po code might be internally calling hr code which might inturn be calling fnd code.
Hence it’s best to set this profile value as %.
You may also use comma delimited values i.e po%,hr%,fnd%

Why must I bother debugging Oracle's Standard code when I can quickly raise a tar.
If the issue is with Standard Oracle Code, first thing you must do is to search into Metalink. However having the debug information on error helps your searching ability further. Uploading the debug messages upfront during Tar creation will also help Oracle speedily understand and fix your issues.

Why to set the profile option to statement level?
This profile option has following main levels.-

I like setting this to "Statement" level as it extracts debug messages at all levels, in one glance. You can latter filter those debug messages by using below SQL for example
select * from fnd_log_messages where user_id = 111 and LOG_LEVEL =5     

What if the piece of code causing the error is not appearing in fnd_log_messages?
This is very much possible. The fnd_log_messages might have helped you get close to the culprit piece of code , but may not be able to pinpoint the error as there may not be enough debug messages implanted by Oracle.

You can do one of the below:-
A. Run the database sql trace for the session with bind variables and see the last meaningful SQL statement in the raw trace file.
Please note that PL/SQL statements will not appear in trace, only the SQL Statements will appear, hence you may consider option (b) below
B. Add your own debug messages to the pl/sql code that was delivered by oracle, which you suspect is causing problem. This is a temporary change, and must only be done on development environment, NEVER DO THIS CHANGE ON PRODUCTION.

The size of table FND_LOG_MESSAGES will keep on increasing?
You can run concurrent program “Purge Debug Log and System Alerts”.

I have written a pl/sql concurrent process to interface Purchase Orders from 3rd Party System. How will add debug messages?
    fnd_log.STRING(log_level => fnd_log.level_statement
                  ,module    => 'xxpo.packagename.procedurename'
                  ,message   => 'debug message here');

Will the above debug command create an entry into fnd_log_messages ?
Debug records will be created in fnd_log_messages if and only if you run the interface program after setting the profile options as suggested above.

What if a rollback occurs due to unhandled exception. Will the inserts done to fnd_log_messages be lost?
fnd_log.string eventually calls procedure  FND_LOG.STRING_UNCHECKED_INTERNAL2. This procedure uses pragma AUTONOMOUS_TRANSACTION with a commit.
Hence your debug messages will not be lost despite a rollback in parent session.

What if an exception is incurred within the Debug Logging API itself?
Oracle takes well care of this by handling the WHEN OTHERS exception.
It is evident from below Oracle Code for debug API
                    MODULE    IN VARCHAR2,
                    MESSAGE   IN VARCHAR2) is

      /* Short circuit if logging not turned on at this level */
      end if;

                               LOG_LEVEL       => LOG_LEVEL,
                               MODULE          => MODULE,
                               MESSAGE_TEXT    => MESSAGE);
      end if;

         when others then
        NULL; /* supress the exception */

Anil Passi


0 #1 Anil Passi 2007-01-21 00:00
Hi Yeshvant,

Yo u do not need to run any interface process after setting these.

Thank s,
Anil Passi
0 #2 Yeshvant 2007-01-21 00:00
Thanks for the valuable information that you are providing here.

What is the interface program that shud be run after setting the profile options?
0 #3 Anil Passi 2007-01-21 00:00
Hi Yeshvant,

Yo u do not need to run any interface process after setting these.

Thank s,
Anil Passi
0 #4 Yeshvant 2007-01-21 00:00
Thanks for the valuable information that you are providing here.

What is the interface program that shud be run after setting the profile options?
0 #5 Koushik 2007-01-31 00:00
Thanks for explaining in such a beautiful manner...All my doubts regarding the Debug messages are solved now....awesome explanation..
0 #6 Vijay 2007-04-26 00:00
Great stuff! Very useful!
0 #7 namita 2007-05-22 00:00
Can we use these fnd_log.STRING in Reports also?
0 #8 minwoo kang 2007-11-12 07:37
Very useful!
0 #9 srikanth 2007-12-04 16:28
Hi Anil,

Thanks for another great article.

0 #10 MMW 2008-02-01 13:31
Thanks for the usefull explanation. I tried it in a pll, but did not see any result. The solution was to add the app-schema to the call:
app.fnd_log.str ing(log_level => 1,
module => 'XXBZ_JRG.is_ac tive',
message => 'MMW Test degug');
0 #11 Anill Passii 2008-02-01 13:35
What are the values of your FND Log profile options?

FND: Debug Log Enabled
FND: Debug Log Level
FND: Debug Log Module
0 #12 MMW 2008-02-01 13:52
I used the code in both a database PL/SQL package and in a PLL. The debug lines in the PLL didnot show up. Perhaps there is some other FND_LOG.string in a library which swallows my message. I posted this message to make people aware to user the apps-scheme in pll/fmb code.
0 #13 Somali 2008-03-11 13:55
FND: Debug Log Enabled is set to yes at site level as well as user level but 'About this page' link isn't appearing in the jsp pages of this particular user. Please suggest.
0 #14 Anil Passi 2008-03-11 13:58
Hi Somali

You need to set profile "FND: Diagnostics"
Th is will enable the about this page link.

Anil Passi

Add comment

Security code

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Aug 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
  2  3  4  5  6  7  8

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates

Powered by Google FeedBurner