Discussions

EJB programming & troubleshooting: Logging based on EAR

  1. Logging based on EAR (1 messages)

    Our app is currently logging using Log4j at application level. There are at least 8 EAR files, which are deployed when the server runs. All 8 EAR's are logging into File1.log file. I want to separate 1 ear. For example, 7 EAR files should conitnue logging in File1.log file however, the 8th one say ABCD.EAR should log into ABCD.LOG file.


    I am able to log things based on class heirarchi. But there are number of classes, who doesn't fall under specific hierarchy but still fall under ABCD.EAR. How can i configure my log4j.xml based on EAR. My current settings for ABCD loggins are

    [code=java]<appender name="ABCDAppender" class="org.apache.log4j.RollingFileAppender">        <param name="File" value="./logs/abcd.log" />        <param name="Append" value="true" />        <param name="MaxFileSize" value="100MB" />        <param name="MaxBackupIndex" value="10" />        <layout class="provision.services.logging.PSPatternLayout">            <param name="conversionPattern" value="%d %D %S %-5p {%P} %#: [%-17c{5} %T] %m%n" />        </layout>    </appender>
    <logger name="project.abcd">    <level value="DEBUG"/>    <appender-ref ref="ABCDAppender"/></logger>[/code]

    this currently logging all log information for the classes falls under project.abcd, but there are other classes which are in abcd.ear but not being logged. 

    Threaded Messages (1)

  2. You should used[ Go to top ]

    Are you using the latest versions of EAR like 1.2.16? As earlier versions didn't seem to work. - Michael Courouleau