project BLF > class tLogger > method Main

Description

Main block procedure


Parameters


ocFolderNameoutputcharacter


Internal usage


BLF
method BApplicationProperty.APIGetAppServerInformation
method ComponentPool.StartLoggerInPool
method Session.GetCTLogFileLocation

QadFinancials
method BConCheckProcessor.ConCheckProcessInit


program code (program1/tlogger.p)

/* ========================================================= */
/* Find the location where the log file should be created    */
/* ========================================================= */

assign vcFile = search ("server.xml":U)
       vhFcComponent = ?.
<M-1 run MainBlock () in XML>

<M-3 run ReadXMLNodeValue
   (input  vcFile (icXMLFile), 
    input  'logging':U (icStartTag), 
    input  'LoggingDirectory':U (icNodeTag), 
    output vcLoggerOutputFolder (ocNodeValue), 
    output viFcReturnSuper (oiReturnStatus)) in XML>

if index(vcLoggerOutputFolder,"$ENVROOT") > 0
then do:
    <M-5 run ReadXMLNodeValue
       (input  vcFile (icXMLFile), 
        input  'serverConfiguration' (icStartTag), 
        input  'ENVROOT' (icNodeTag), 
        output vcFcMaskList (ocNodeValue), 
        output viFcReturnSuper (oiReturnStatus)) in XML>
    vcLoggerOutputFolder = replace(vcLoggerOutputFolder,"$ENVROOT",vcFcMaskList).
end.

run gipr_DeleteProcedure in vhFcComponent.
delete procedure vhFcComponent.

if vcLoggerOutputFolder <> ""
then do:
    file-info:file-name = vcLoggerOutputFolder.
    if file-info:file-type = ?
    or index(file-info:file-type,"D":U) = 0
    or index(file-info:file-type,"R":U) = 0
    then 
        vcLoggerOutputFolder = "".    /* not a valid directory with write permissions */
    else
        vcLoggerOutputFolder = file-info:full-pathname.
end.

if vcLoggerOutputFolder = ""
then vcLoggerOutputFolder = session:temp-dir.

<M-4 run CreateExceptionList  () in tLogger>

ocFolderName = vcLoggerOutputFolder.