logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sriram Venkatasubramanian" <Sriram.Venkatasubraman...@adeasolutions.com>
Subject RE: Log4j logging to System.out?
Date Thu, 21 Jul 2005 04:57:55 GMT
I am also facing the same problem . Here is my log4j.xml.

 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
	<appender name="SERVER_FILE"
class="org.apache.log4j.RollingFileAppender">
		<param name="File"
value="${oc4j_j2ee_home}/log/server.log"/>  
		<param name="Append" value="false"/>
		<param name="Threshold" value="INFO"/>
		<param name="DatePattern" value="'.'yyyy-MM-dd"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d %-5p
[%c] %m%n"/>
		</layout>
	</appender>

	<appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
		<param name="Threshold" value="INFO"/>
		<param name="Target" value="System.out"/>
		<layout class="org.apache.log4j.PatternLayout">
			<!-- The default pattern: Date Priority
[Category] Message\n -->
			<param name="ConversionPattern"
value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
		</layout>
	</appender>

	<appender name="STRUTS_ACTION"
class="org.apache.log4j.RollingFileAppender">
		<param name="File"
value="${oc4j_j2ee_home}/log/server.log"/>  
		<param name="Append" value="false"/>
		<param name="MaxFileSize" value="200KB"/>
		<param name="MaxBackupIndex" value="100"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d %-5p
[%c{1}] %m%n"/>
		</layout>
	</appender>
		
	<appender name="DAO_FRAMEWORK"
class="org.apache.log4j.DailyRollingFileAppender">
		<param name="File"
value="${oracle.j2ee.home}/log/DAOFramework.log"/>
		<param name="Append" value="true"/>
		<param name="MaxFileSize" value="200KB"/>
		<param name="MaxBackupIndex" value="100"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d %-5p
[%c{1}] %m%n"/>
		</layout>
	</appender>
		
	<appender name="IN_OUT_LOG"
class="org.apache.log4j.RollingFileAppender">
		<param name="File"
value="${oc4j_j2ee_home}/log/server.log"/>  
		<param name="Append" value="false"/>
		<param name="Threshold" value="INFO"/>
		<!-- Rollover at midnight each day -->
		<param name="DatePattern" value="'.'yyyy-MM-dd"/>
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%-5p %d
%m%n"/>
		</layout>
	</appender>


	<!-- DAO Framework -->
	<logger name="DAO" additivity="false">
		<level value="INFO"/>
		<appender-ref ref="CONSOLE"/>
		<appender-ref ref="DAO_FRAMEWORK"/>
	</logger>	
		
	<!-- All Action Classes -->
	<logger name="StrutsAction" additivity="false">
		<level value="INFO"/>
		<appender-ref ref="CONSOLE"/>
		<appender-ref ref="STRUTS_ACTION"/>
	</logger>
	
	<logger name="INOUT_LOG" additivity="false">
		<level value="DEBUG"/>
		<appender-ref ref="IN_OUT_LOG"/>
	</logger>
	
	<!-- Root Logger -->
	<root>
	    <level value="DEBUG"/>
	    <appender-ref ref="CONSOLE"/>
	    <appender-ref ref="SERVER_FILE"/>
	</root>

</log4j:configuration>

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Thursday, July 21, 2005 9:30 AM
To: Log4J Users List
Subject: Re: Log4j logging to System.out? 

At 10:00 PM 7/20/2005 -0400, you wrote:
 >For some reason it looks like log.info(...) logs also to System.out.
When I
 >start my application in a console window, these statements log to the
log
 >file and the console?  Any way to get it to stop?

Can't begin to tell you until we see your config file.

Jake


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message