INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Logs from different web apps go to same file with log4j?!

Logs from different web apps go to same file with log4j?!

(OP)
Hi, The problem is the following - I have several web apps, running in Tomcat 6. I've noticed that all logs go to one file, which is specific for only one of the web applications! Each file in each application is named unique. What I did wrong?

Here is the log4j.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="ROLLING_FILE_DEBUG" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/logs/ssoapps_debug.log" />
        <param name="MaxFileSize" value="2MB" />
        <param name="MaxBackupIndex" value="10" />
        <param name="Threshold" value="DEBUG" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1} - %m%n" />
        </layout>
    </appender>
    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n" />
        </layout>
    </appender>
    <logger name="com.sbc" additivity="false">
        <priority value="debug" />
        <appender-ref ref="ROLLING_FILE_DEBUG" />
    </logger>
    <logger name="org.apache.log4j.xml" additivity="false">
        <priority value="OFF" />
        <appender-ref ref="STDOUT" />
    </logger>
    <root>
        <priority value="info" />
        <appender-ref ref="STDOUT" />
    </root>
</log4j:configuration>
 

RE: Logs from different web apps go to same file with log4j?!

I don't understand the question. You're settting the same file for all of them?  

Cheers,
Dian

RE: Logs from different web apps go to same file with log4j?!

(OP)
No, each application has its own file, but in this strange situation all logs go to one file, which is property of only one application.

RE: Logs from different web apps go to same file with log4j?!

Could you post the configuration file for a different application?

Cheers,
Dian

RE: Logs from different web apps go to same file with log4j?!

(OP)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"    xmlns:log4j="http://jakarta.apache.org/log4j/">
    
    <appender name="ROLLING_FILE_DEBUG_PP" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/logs/paymentportal_debug.log" />
        <param name="MaxFileSize" value="2MB" />
        <param name="MaxBackupIndex" value="10" />
        <param name="Threshold" value="DEBUG" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1} - %m%n" />
        </layout>
    </appender>

    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n" />
        </layout>
    </appender>
    
  <logger name="com.sbc" additivity="false">
    <priority value="debug" />
    <appender-ref ref="ROLLING_FILE_DEBUG_PP"/>
  </logger>

    <logger name="org.apache.log4j.xml" additivity="false">
        <priority value="OFF" />
        <appender-ref ref="STDOUT" />
    </logger>

    <root>
        <priority value="info" />
        <appender-ref ref="STDOUT" />
    </root>
</log4j:configuration>
 

RE: Logs from different web apps go to same file with log4j?!

Looks ok to me, where are you putting each file?

Cheers,
Dian

RE: Logs from different web apps go to same file with log4j?!

(OP)
In WEB-INF\classes

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close