webMethods

webMethods

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
Expand all | Collapse all

Forward Azure SDK logs to a custom log file

  • 1.  Forward Azure SDK logs to a custom log file

    Posted Thu November 23, 2023 04:24 AM

    Hi guys,

    I am currently working on a solution to connect to an Azure Service Bus and consume some messages using the Azure java sdk libraries. I noticed that logs are going to sag-osgi.log and wanted to have them in a custom rolling file.

    For this I had as reference this and added following to the log4j2.properties file from IS/configuration/logging:

    appender.rolling.type = RollingFile
    appender.rolling.name = Azure.SDKLogFile
    appender.rolling.fileName = /wmhome/data/AzureSDK/LOG/azureSdkLog.log
    appender.rolling.filePattern = /wmhome/data/AzureSDK/LOG/azureSdkLog.%d{dd-MMM}.log.gz
    appender.rolling.layout.type = PatternLayout
    appender.rolling.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %m%n
    appender.rolling.policies.type = Policies
    appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
    appender.rolling.policies.size.size=10MB
    appender.rolling.strategy.type = DefaultRolloverStrategy
    appender.rolling.strategy.max = 5
    
    logger.10.name=com.azure.core
    logger.10.level=debug
    logger.10.appenderRef.rolling.ref=Azure.SDKLogFile
    

    After doing this, I noticed following error in the wrapper.log:

    INFO   | jvm 1    | 2023/11/23 10:15:59 | 2023-11-23 10:15:59.432 : Integration Server detected loss of its Log4j configuration. Integration Server is restoring its Log4j configuration.
    INFO   | jvm 1    | 2023/11/23 10:15:59 | 2023-11-23 10:15:59,495 Log4j2-TF-17-ConfiguratonFileWatcher-6 ERROR Unable to locate appender "Platform.RollingLogFile" for logger config "root"
    

    Any idea what I can do to fix this?


    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Forward Azure SDK logs to a custom log file

    Posted Sun December 17, 2023 08:32 AM

    Hi @niemand23
    The added entries look correct. The location of the added entries in the configuration could be affecting the existing configuration for the root logger which use the Platform.RollingLogFile appender. Please verify/ share the complete log4j2.properties file contents.

    -NP


    #webMethods
    #Integration-Server-and-ESB