App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Applicationintegration
#App Connect
#AppConnect
 View Only
  • 1.  Configuring log4j on App Connect as service on AWS

    Posted Sun May 14, 2023 11:54 AM

    Hello,

    I am exploring App Connect as service on AWS and i need help Configuring log4j on App Connect as service on AWS.

    Could you please help me out if anyone has Configured log4j on App Connect as service on AWS.

    Thanks and Regards,
    Sainath



    ------------------------------
    Sainath Reddy Police
    ------------------------------


  • 2.  RE: Configuring log4j on App Connect as service on AWS

    Posted Wed May 17, 2023 04:08 AM

    Hello,

    Hopefully you can see from the screenshot below, you can use Log4j within a Java Compute Node by including JARs and configuration in the BAR file. I achieved this here by switching to the "Navigator" view and putting the JAR files alongside my .java and .class files in /com/martin (and updating the Java Build Path the reference them) and putting the log4j2.xml in the root of the Java project.


    Please reach out if you have any further questions or issues.


    ------------------------------
    Martin Ross
    IBM
    ------------------------------



  • 3.  RE: Configuring log4j on App Connect as service on AWS

    Posted Wed May 17, 2023 11:30 AM

    Hi Martin Ross,

    Thanks for your reply.

    Could you please let me know how to implement log4j using compute node and deploy that app on  App Connect Dashboard.

    Thanks and Regards,
    Sainath Reddy



    ------------------------------
    Sainath Reddy Police
    ------------------------------



  • 4.  RE: Configuring log4j on App Connect as service on AWS

    Posted Wed May 17, 2023 12:01 PM

    Hello,

    You can use the ESQL CREATE function and CALL procedure within a Compute Node to call functions written in Java from ESQL. Please see following App Connect Enterprise documentation for further details:

    https://www.ibm.com/docs/en/app-connect/12.0?topic=esql-using-call-statement-call-user-written-routine
    https://www.ibm.com/docs/en/app-connect/12.0?topic=statements-create-function-statement#ak04960___ak04960_jmp8__title__1



    ------------------------------
    Martin Ross
    IBM
    ------------------------------



  • 5.  RE: Configuring log4j on App Connect as service on AWS

    Posted Wed May 17, 2023 12:15 PM

    Hi Martin Ross,

    Thank you for your response.

    I will implement it and let you know how it goes.

    Thanks and Regards,
    Sainath



    ------------------------------
    Sainath Reddy Police
    ------------------------------



  • 6.  RE: Configuring log4j on App Connect as service on AWS

    Posted Thu May 18, 2023 04:48 AM
    Edited by Sainath Reddy Police Thu May 18, 2023 05:01 AM

    Hi Martin Ross,

    I have implemented the Log4j in Compute node as you have mentioned earlier and its working for me.

    Although i have one question in log4j2.xml, in the toolkit locally i am able to create the entries for log4j and lets say i deploy the same bar file on App Connect Dashboard what value should i give in place of below fields in log4j2.xml. so that i can see the log4j entries on dashboard.

    <Property name="basePath">/tmp</Property>
    <File name="FILE" fileName="${basePath}/logfile.log" append="true">


    Please find the attached screenshot.





    Thanks and Regards,
    Sainath reddy



    ------------------------------
    Sainath Reddy Police
    ------------------------------



  • 7.  RE: Configuring log4j on App Connect as service on AWS

    Posted Fri June 23, 2023 01:42 PM

    Hi Sainath,

    Currently there are a few fields and specific values you would have to include - we are working on making this experience better but this should get you going. I have tested a sample flow using 

    the following Log4j configuration:

    <Configuration>
        <Appenders>
            <Console name="Console" target="SYSTEM_OUT">
            	<PatternLayout pattern='{"custLogSendEnabled":true,"type": "ace_message","tenantId":"XXXXXXXX","logTargetLabel":"CustLog","ibm_datetime":"%d{yyyy-MM-dd}T%d{HH:mm:ss.SSS}Z","loglevel":"info","message":"%m"}%n'/>
            </Console>
        </Appenders>
    
        <Loggers>
            <Root level="INFO">
                <AppenderRef ref="Console"/>
            </Root>
        </Loggers>
    
    </Configuration>

    The tenantId should be set to the identifier for your service instance where the flow is running, this can be seen in the URL for you instance - in the following example the tenantId is "l0hsovciy": https://l0hsovciy-dashboard.p-lon-c1.appconnect.automation.ibm.com/home

    You should then see the logs appear in the built-in log viewer:



    ------------------------------
    Martin Ross
    IBM
    ------------------------------