Get Logging

We have had several requests on how to write log messages while publisher is processing a job. Its not a published API ... it ought to be but for now ...


We have a class you can use in your java code called Logger, just use the following import:


import oracle.apps.xdo.common.Logger;


General Usage

This class is designed as a static class so that you can use this * class without creating an instance. Basically, all you have to do * to log the message is to call a log() method. The example is following. * *
// Log a message 
Logger.log("Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT);
// Log a message with the current object
Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT);
// Log an exception Logger.log(exception);
// Log an exception with level.
Logger.log(exception, Logger.EXCEPTION);
// Log an exception with level and the current object
Logger.log(this, exception, Logger.EXCEPTION);

Logging level

There are 7 logging levels following. Levels are shown in  descending order of severity. The top one is the most severe.

  • UNEXPECTED
  • ERROR
  • EXCEPTION
  • EVENT
  • PROCEDURE
  • STATEMENT
  • OFF
There are 2 logging levels used in this class. One is the system logging level, another one is the logging level for  each log message. Only log messages which have a level greater  than or equal to the system logging level will be logged.  When you set the system logging level to 'OFF', no log info  will be displayed. You can set the system logging level by calling setLevel() method.  The default system logging level is EXCEPTION. You can set the logging level for each log message by passing  the level parameter to each log() method. 
// Set the system logging level to EXCEPTION * 
Logger.setLevel(Logger.EXCEPTION);
// This log message will not be logged because the message
// logging level is lower than EXCEPTION
Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT);
// This log message will be logged because the message
// logging level is the same or higher than EXCEPTION
Logger.log(this, "Copying string from buffer xyz to buffer zyx." , Logger.EXCEPTION);

How do I get to the log?


Standalone - In standalone versions (10.1.3.2) you can turn logging on for the install via the Admin > Server Configuration page. Here you can turn the logging on or off.


EBS - this is a little more involved to get the logging running ...


1. Create a file called xdodebug.cfg
2. The contents of the file should be:


  LogLevel=STATEMENT 
  LogDir=c:temp 
 
  LogLevel specifies the level of logging, this should always be set to STATEMENT to maximize the information provided in the log.
  LogDir specifies where the debug files should be written to, this needs to be a writable directory for XMLP.

3. This file should then be saved to the $JRE_TOP/lib directory.


Once you have the logging turned on you can then run the process thats causing issues and your messages will be written to the log. Just remember to turn it off afterwards.


Now get loggin'

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today