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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  configure logback on webmethods

    Posted 08/14/17 08:09 AM

    Hi,

    I am trying to use logback as the logging framework for my flow services. I have created a JAVA service for this.

    But I am unable to see the log file created by the service.

    IDataCursor pipelineCursor = pipeline.getCursor();
    String	logbackXML = IDataUtil.getString( pipelineCursor, "logbackXML" );
    String	logfileName = IDataUtil.getString( pipelineCursor, "logFile" );
    
    System.setProperty("logback.configurationFile", logbackXML);
    System.setProperty("logfilePath", logfileName);
    
    Logger log =  LoggerFactory.getLogger("ROOT");
    log.info("------------into the info logger--------------");

    Same code snippet is working fine when I called from a stand alone Java class, but the same not generating the log file when called from JAVA service. And no errors or exceptions are being generated too.

    webMethods version 9.10
    Using Package class loader

    Any hints or pointers to resolve this is highly appreciated.


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


  • 2.  RE: configure logback on webmethods

    Posted 08/15/17 03:27 PM

    do you see any error messages in server log or error log when you call such logging service?


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


  • 3.  RE: configure logback on webmethods

    Posted 08/16/17 02:27 AM

    Hi, The log is getting written on the default location: /profiles/IS_default/logs/sag-osgi.log

    And the logs are not getting written as configured inside the logback.xml file. :frowning:

    logback xml as below:

    <configuration>
    
    <property file="/product/softwareag/webmethods910/IntegrationServer/instances/default/packages/logBackPOC/config/logBack.properties" />
    
    
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder 
    by default -->
    <encoder>
    <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
    </pattern>
    </encoder>
    </appender>
    
    <appender name="ROLLINGFILE"
    class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!-- <file>${logfilePath:-${fileLocation}}/myApp.log</file> -->
    <prudent>true</prudent>
    <encoder>
    <pattern>%d %p [%t] %r %msg%n</pattern>
    </encoder>
    
    <rollingPolicy
    class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
    <!-- daily rollover -->
    <fileNamePattern>${logfilePath:-${fileLocation}}-%d{yyyy-MM-dd}.%i.log
    </fileNamePattern>
    <maxFileSize>20MB</maxFileSize>
    <!-- keep 30 days' worth of history capped at 3GB total size -->
    <maxHistory>30</maxHistory>
    <totalSizeCap>20GB</totalSizeCap>
    
    </rollingPolicy>
    
    </appender>
    
    <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
    <appender-ref ref="ROLLINGFILE" />
    <discardingThreshold>0</discardingThreshold>
    <queueSize>64</queueSize>
    </appender>
    
    
    <root level="debug">
    <appender-ref ref="ROLLINGFILE" />
    </root>
    </configuration>

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


  • 4.  RE: configure logback on webmethods

    Posted 08/16/17 03:20 AM

    Hi,

    Able to resolve the issue by updating the class loader settings to package class loader.

    Administrators Guide documentation reference:


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