IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online 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.

 View Only
  • 1.  log4j - Unix path

    Posted Mon June 24, 2019 03:38 PM

    Hi All,

    We have implemented the log4j mainly for logging, currently in windows. I need to know how to mention the UNIX path.
    Herewith attached the log4.xml for reference.

    Regards,
    Hari
    log4j.xml (725 Bytes)


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: log4j - Unix path

    Posted Mon June 24, 2019 11:33 PM

    Did you try with below

    ${user.home}/SAG/My.log, user generally has right to write in home dir.

    Our Logger is configured on Linux and here is the sample xml.

    <appender name="XXXX" class="ch.qos.logback.core.FileAppender">
    
    <file>logs/log4j.log</file>
    
    <append>true</append>
    
    <encoder>
    
    <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{50} %3([%.-1level]): %msg%n</pattern>
    
    </encoder>
    
    </appender>

    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: log4j - Unix path

    Posted Wed June 26, 2019 01:48 PM

    Hi Mahesh,

    Thanks a lot for the details.
    Promoted the changes in DEV, waiting this to be tested in DEV.

    Regards,
    Hari


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: log4j - Unix path

    Posted Thu July 18, 2019 09:00 AM

    Hi Mahesh, All,

    This is the DOMConfigurator.configure(fileName) built in method which creates the file by reading all the parameters from the log4j.xml file.

    N/w admin has informed that these variables are not initialized under user profile and our the program needs to read those variables from “wrapper.conf” file of respective instances using some java code to get the values from wrapper.conf file.

    Option-1:
    Any thoughts on how to implement this?

    Option-2:
    I can set the “log file path” in each respective environments specific XML file (ex: dev_log4j.xml, qa_log4j.xml) and this XML file can be identified by configuration.property file key/value. Moreover this key can be identified using the ‘IS GLOBAL Variable for environment’ (‘ENV-VAR= / / ’)

    configuration.property
    DEV_configFilePath=“dev_log4j.xml”,
    QA_configFilePath=“QA_log4j.xml”,
    PROD_configFilePath=“PROD_log4j.xml”

    dev_log4j.xml

    QA_log4j.xml

    Here in PROD, we have 2 nodes, in both, we have the GLOBAL VARIABLE ENV_VAR=PROD, so we can’t two different key/value for PROD in the property file. Here is the key/value place were we give different paths for the log file.

    PROD_log4j.xml

    This will create the log file only in PROD1, not in PROD2.

    Could you please tell me, how to identify the PROD01 and PROD02 node
    How to overcome this ?

    dev - /runtime/installed/SoftwareAG/IntegrationServer/instances/IS_Inst01/logs/
    QA - /runtime/installed/SoftwareAG/IntegrationServer/instances/ISClusterNode01/logs
    PROD1 - /runtime/installed/SoftwareAG/IntegrationServer/instances/ISClusterNode01/logs
    PROD2 - /runtime/installed/SoftwareAG/IntegrationServer/instances/ISClusterNode02/logs

    Regards,
    Hari


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: log4j - Unix path

    Posted Thu July 18, 2019 10:01 AM