You'll need to configure Jboss to send system out someplace else; the use of a 
ConsoleAppender does not mean that log4j automatically or magically redirects 
any calls to System.out to someplace else. 

When you say "i am setting the Rolling appender as the root appender  then its 
child appender(Console Appender) message should also be stored in 
jbosswork1.log. Means all sysouts should come in  jbosswork1.log.", I think you 
are misunderstanding the purpose or the way that ConsoleAppender works. 
ConsoleAppender will simply append log messages to the console - wherever that 
happens to be (whether it is an actual console or redirected to a file).

-----Original Message-----
From: div_gect [mailto:divya.g...@techblue.co.uk] 
Sent: Tuesday, April 21, 2009 10:24 AM
To: log4j-user@logging.apache.org
Subject: Client side logging


Hi all

    Here i am executing a simple programme of log4j.

Here is programme-

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;


public class first {

public static void main(String args[])

{
        Logger logger=Logger.getLogger("first");
   
       DOMConfigurator.configure("c:\\log4j1.xml");
        
       System.out.println("This is  a sysout"); 
    logger.warn("Tsis is warning");
}

}


And here is log4j1.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration 
xmlns:log4j="http://jakarta.apache.org/log4j/";
debug="true" >

   

    <appender name="ROLLING" class="org.apache.log4j.FileAppender">
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
         
        </layout>
   
      
 
   
    </appender>

    <appender name="CONSOLE1" class="org.apache.log4j.ConsoleAppender">
       
      
      
      <layout class="org.apache.log4j.PatternLayout">
         
         
      </layout>
   </appender>
    
    <category name="first">
        <priority value="DEBUG"/>
        <appender-ref ref="ROLLING"/>
    </category>

    <category name="org.apache">
        <priority value="WARN"/>
    </category>

    <root>
     
        <appender-ref ref="ROLLING"/>
    
    </root>

</log4j:configuration>

      Now my issue is here as i am setting the Rolling appender as the root 
appender  then its child appender(Console Appender) message should also be 
stored in jbosswork1.log. Means all sysouts should come in  jbosswork1.log.
While it is not happening ,only warn message is getting stored. Here i am using 
eclipse Gynamede.
  
    My requirment is to store all sysouts in log file.How can i perform it?
Should i provide some VM parameter.?Any suggestions most welcome.

Thanks
Divya Garg




--
View this message in context: 
http://www.nabble.com/Client-side-logging-tp23157248p23157248.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


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

Reply via email to