Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2014-03-22T22:59:34Z by fjb_saper
VF3B_Gabriel_Huerta
VF3B_Gabriel_Huerta
22 Posts
ACCEPTED ANSWER

Pinned topic Using log4j with WebSphere Message Broker

‏2013-10-17T13:50:15Z |

Hi

Beforehand I ask for apologies for my poor knowledge about this matter. But I tried what has been stated for this subject "Configuring the Log4j node in WebSphere Message Broker", and I can not generate a log4j file. I am using below brokerlog.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
        <appender name="FILE" class="org.apache.log4j.FileAppender">
            <param name="Threshold" value="WARN"/>
            <param name="File" value="/tmp/migoss.log"/>
            <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%-10t] %m%n"/>
            </layout>
        </appender>
        <logger name="default">
            <level value="WARN"/>
            <appender-ref ref="FILE"/>
        </logger>
        <root>
            <appender-ref ref="FILE"/>
        </root>
</log4j:configuration>


File /tmp/migoss.log is not being generated. I have a problem with broker's CLASSPATH. How this is set?

According with what I have understood, I do as indicated below:

CLASSPATH=<path where are brokerlog.xml and log4j.dtd files>.
export CLASSPATH

What else can I do in order to solve this problem?

  • VF3B_Gabriel_Huerta
    VF3B_Gabriel_Huerta
    22 Posts
    ACCEPTED ANSWER

    Re: Using log4j with WebSphere Message Broker

    ‏2013-10-21T21:13:39Z  in response to VF3B_Gabriel_Huerta

    Thanks Matthias, for your valuable help.

    I do not know if what I did, it was the real solution but it works!!!. I put brokerlog.xml file along with log4j.dtd in /var/mqsi as if the path  defined in MSQSI_WORKPATH variable, was taken as CLASSPATH. This change done and using INFO log level solved this issue.

  • Rengaraj
    Rengaraj
    3 Posts
    ACCEPTED ANSWER

    Re: Using log4j with WebSphere Message Broker

    ‏2013-10-30T10:23:56Z  in response to VF3B_Gabriel_Huerta

    Hi,

     

    You can set MQSI_FILENODES_ROOT_DIRECTORY = \var\applog\mqsi\

    then plce the dtd and log.xml in it.

    and broker automatically take this path for all Input node and all file level triggers.

    Also You can place log4j jars jakarta-oro-2.0.4,log4j-1.2.8,Log4jLoggingNode_v1.2.1 in to broker work path i.e C:\ProgramData\IBM\MQSI\shared-classes\ (\var\ibm\mqsi\shared-classes).

    For reference: IAM3.pdf

    Regards,

    M.Rengaraj.

    Attachments

    • parvind
      parvind
      1 Post
      ACCEPTED ANSWER

      Re: Using log4j with WebSphere Message Broker

      ‏2014-03-05T14:53:43Z  in response to Rengaraj

      Hi Gabriel,

      Could you please share the PI.

      I've done all the required configuration. Flow runs fine but doesn't generates the log. Not sure what's wrong with it.

      • fjb_saper
        fjb_saper
        121 Posts
        ACCEPTED ANSWER

        Re: Using log4j with WebSphere Message Broker

        ‏2014-03-22T22:59:34Z  in response to parvind

        Best practice says: ditch log4j in favor of java.util.logging