CDF: Logging Functions
There are three different ways to perform logging using a CDF. The first is using the JAPI logging capabilities. The second is using a third party logging package like “Log4J”. Finally, the Essbase calculator provides for a way to use Essbase logging. I will be discussing the latter two methods in this blog. The Essbase calculator allows for logging within the Essbase application log itself through the use of the Essbase context. Using the logging CDF, this can only be accessed using the RUNJAVA command in a calc script. An example of this would be as follows:
RUNJAVA com.hyperion.essbase.cdf.LogFunctions "The calc script has finished";
Using a third party logger like Log4J, there are dependency files that must be included in the UDF directory along with the CDF jar file. In this case, the log4j-1.2.8.jar file (which can be found under the Hyperion/Common directory structure) and the log4j.properties file. The properties file will need to be modified to direct the log output file to the appropriate location on your machine. There are two functions in the logging CDF:
@JlogDebug (string, string array, double array)
Logs a debug message to the Log4J log file.
@JlogDebug("On Budget" ,@LIST(@NAME(@CURRMBR(Year)) ,@NAME(@CURRMBR(Market)) ,@NAME(@CURRMBR(Measures)) ,@NAME(@CURRMBR(Product)) ,@NAME(Actual) ,@NAME(Budget)) ,@LIST(Actual,Budget));
“2009-04-21 15:49:41,875 DEBUG On Budget :: Jan New York Profit 100-10 Actual Budget 0.0 -2.0E-15”
@JlogError (string, string array, double array)
Logs an error message to the Log4J log file.
@JlogError("Over Budget" ,@LIST(@NAME(@CURRMBR(Year)) ,@NAME(@CURRMBR(Market)) ,@NAME(@CURRMBR(Measures)) ,@NAME(@CURRMBR(Product)) ,@NAME(Actual) ,@NAME(Budget)) ,@LIST(Actual,Budget));
@JlogError("Over Budget" ,@LIST(@NAME(@CURRMBR(Year)) ,@NAME(@CURRMBR(Market)) ,@NAME(@CURRMBR(Measures)) ,@NAME(@CURRMBR(Product)) ,@NAME(Actual) ,@NAME(Budget)) ,@LIST(Actual,Budget));
“2009-04-21 15:49:41,875 ERROR Over Budget :: Dec New York Profit 100-10 Actual Budget 51.0 40.0” Source for these functions can be found here.










