First usage: Reference org. Apache. commons. Logging. log.
Import org. Apache. commons. Logging. log;
Import org. Apache. commons. Logging. logfactory;
Private Static final log logger = logfactory. getlog (yyappbizaction. Class); // policyappbizaction. Class is the current class name defined by the user.
Logger.info ("============================== calc start ================ ========== ");
Logger. debug ("passed parameter =>" + PARAM );
Logger. debug ("submittounderwriting: parameter =>" + servicerequest. getcust_data ());
Catch (exception e ){
Logger. Error ("Group Ticket insurance VO property copy exception. yyappbizaction. procgroupcvrg ()");
Throw new businessserviceexception (E );
}
Second usage: Call log4j.
Import org. Apache. log4j. Logger;
Private logger = logger. getlogger (this. getclass (); // This. getclass () indicates the current class.
Public logger getlogger (){
Return this. Logger;
}
Public void setlogger (logger ){
This. Logger = logger;
}
This.logger.info ("=================== calling the platform interface to insure against pre-confirmation errors ==================== ======== ");