BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  BAW Custom logging

    Posted Wed July 05, 2023 09:27 AM

    Dears,

    is their any whay to use log4j library for custom logging on IBM BAW 22 or higher?



    ------------------------------
    [ahmed] [shaheen]
    [System developer]
    [valleysoft-eg]
    [Cairo] [Egypt]
    [+20-01015699307]
    ------------------------------


  • 2.  RE: BAW Custom logging

    Posted Thu July 06, 2023 07:39 AM

    I have some experience with trying to get this to work.  Our path was to use LiveConnect (deprecated on containers/cloud) with log4j that was configured in a couple of ways.  The first attempt was to use the version already available on the classpath and the second attempt was to use a custom version of log4j added via managed assets.  For the second attempt, we even tried a repackaged compilation of log4j to isolate it to our own package namespace.  Neither solution worked well, however.  Instead, we took a step back and tried to look at why we were trying to use log4j instead of the base Java logger.  One of the main reasons was the requirement for isolated log files per Process App.  This was accomplished with code such as:
    Logger logger1 = Logger.getLogger("ProcessAppOne");
    logger1.addHandler(new FileHandler("C:/temp/customlogs/logOne.log"));
    logger1.log(Level.SEVERE, echoStr);
    Logger logger2 = Logger.getLogger("ProcessAppTwo");
    logger2.addHandler(new FileHandler("C:/temp/customlogs/logTwo.log"));
    logger2.log(Level.INFO, echoStr);

    The above could be wrapped into a shared managed asset or service with parameterized or automatic detection of the process app name.

    For a built-in solution, the following idea has been created.  Please vote and include any other requirements that you might have on the built-in log APIs:
    https://dba.ideas.ibm.com/ideas/IWF-I-569



    ------------------------------
    Grant Taylor
    ------------------------------