Got this working. Atleast the messages are displayed
on console and the file.

How to change the conversion layout to configure time
as follows on console and file as well

Desired: 8/25/02 1:49:31 PM

Current Conversion 

log4j.debug=true
#log4j.disable=fatal
log4j.additivity.epeople=true

log4j.rootCategory=DEBUG,stdout, R 
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%t]
%-5p %c - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=c:/bea/wlserver6.1/config/sudhendras/logs/epeople.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#log4j.appender.R.layout.ConversionPattern=%d %-5p
%c{1} %M - %m%n
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p
%c - %m%n

log4j.logger.epeople=DEBUG

Pls help.

thanks
sudhi


--- sudhendra seshachala <[EMAIL PROTECTED]> wrote:
> So, can i configure the properties as follows, this
> would ensure that configuration is done before using
> log4j.
> 
> 
> public class Logger
> {
>     // a private logger to log error messages during
> Logger operations
>       private static org.apache.log4j.Logger
> s_localLogger
> =
>            
> org.apache.log4j.Logger.getLogger(Logger.class);
> 
>     // default resource bundle location
>     private static final String
> DEFAULT_RESOURCE_BUNDLE = "Log";
> 
>     // log4j category for this logger
>     private org.apache.log4j.Logger m_logger = null;
> 
>     
>     // This can be externalized through LogResources
>     private static final String EXCEPTION_LOG
> ="Check
> the Stack Trace";
> 
>     /**
>      * Cannot be instantiated directly - use
> getLogger().
>      */
>     private Logger(org.apache.log4j.Logger c)
>     {
>       Properties      nwp = NWProperties.getInstance();
>       Logger.init(nwp, null);
>         m_logger = c;
>     }....
> }
> --- Ceki Gülcü <[EMAIL PROTECTED]> wrote:
> > 
> > The warning message says otherwise.
> > 
> > At 08:25 26.08.2002 -0700, you wrote:
> > >I am loading this property file before doing
> > anything
> > >else. This is the first thing being loaded.
> > >
> > >thanks
> > >sudhi
> > >--- Ceki Gülcü <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > It looks that log4j is configured using your
> > > > configuration file. However,
> > > > you or some other code is attempting to use
> > log4j
> > > > prior to its
> > > > configuration, hence the warning message.
> > > >
> > > > At 07:20 26.08.2002 -0700, you wrote:
> > > >
> > > > >Hi All,
> > > > >I am having problems configuring log4j with
> > > > Weblogic
> > > > >6.1.
> > > > >I have the configuration for log4j as follows
> > in a
> > > > >file called generic properties which get
> loaded
> > by
> > > > a
> > > > >startup class
> > > > >
> > > > >
> > > >
> > >
> >
>
>############################################################################
> > > > ># log4j configuration
> > > >
> > >
> >
>
>############################################################################
> > > > >
> > > > >log4j.debug=true
> > > > >#log4j.disable=fatal
> > > > >log4j.additivity.epeople=true
> > > > >
> > > > >log4j.rootCategory=DEBUG,stdout, R
> > > >
> > >
> >
>
>log4j.appender.R=org.apache.log4j.RollingFileAppender
> > > >
> > >
> >
>
>log4j.appender.R.File=c:/bea/wlserver6.1/config/sudhendras/logger.log
> > > > >log4j.appender.R.MaxFileSize=100KB
> > > > >log4j.appender.R.MaxBackupIndex=1
> > > >
> > >
> >
>
>log4j.appender.R.layout=org.apache.log4j.PatternLayout
> > > > >log4j.appender.R.layout.ConversionPattern=%d
> > %-5p
> > > > >%c{1} %M - %m%n
> > > >
> > >
> >
>
>log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > >
> > >
> >
>
>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > > >
> > > > >log4j.logger.epeople=DEBUG
> > > > >
> > > > >These properties gets loaded as a properties
> in
> > > > >startup class as follows.
> > > > >
> > > > >import java.io.*;
> > > > >
> > > > >import java.util.Properties;
> > > > >import org.apache.log4j.xml.DOMConfigurator;
> > > > >import org.apache.log4j.*;
> > > > >import weblogic.common.*;
> > > > >
> > > > >import com.epeople.config.*;
> > > > >
> > > > >/**
> > > > >  * Insert the type's description here.
> > > > >  * Creation date: (12/5/00 11:12:13 AM)
> > > > >  * @author: Administrator
> > > > >  */
> > > > >public class ApacheLoggerStartUp implements
> > > > >weblogic.common.T3StartupDef {
> > > > >         /**
> > > > >         * ApacheLoggerStartUp constructor
> > comment.
> > > > >         */
> > > > >         private static final String
> > > > m_logConfigurationFile
> > > > >="c:\\ep\\properties\\log4j.properties";
> > > > >         public ApacheLoggerStartUp()
> > > > >         {
> > > > >                 super();
> > > > >         }
> > > > >         /**
> > > > >         * setServices method comment.
> > > > >         */
> > > > >         public void
> > > > setServices(weblogic.common.T3ServicesDef
> > > > >arg1) {
> > > > >         }
> > > > >         /**
> > > > >         * startup method comment.
> > > > >         */
> > > > >         public String startup(String arg1,
> > > > >java.util.Hashtable prop) throws Exception
> > > > >         {
> > > > >                 String resource = null;
> > > > >                 try
> > > > >                 {
> > > > >                     Properties props
> > > > =NWProperties.getInstance();
> > > > >                     Logger.init(props,null);
> > > > >                     return "Log4j
> > configuration
> > > > initialized.";
> > > > >
> > > > >                 }
> > > > >                 catch (Exception e)
> > > > >                 {
> > > > >                   
> System.out.println("Cannot
> > open
> > > > config file: " +
> > > > >resource);
> > > > >                    return "Log4j
> configuration
> > > > failed to
> > > > >initialized.";
> > > > >
> > > > >                 }
> > > > >         }
> > > > >}
> > > > >
> > > > >can anyone help me on this.
> > > > >I get the most dreaded
> > > > >"log4j:WARN No appenders could be found for
> > logger
> > > > >(epeople).
> > > > >log4j:WARN Please initialize the log4j system
> > > > >properly."
> > > > >
> > > > >The sample output is as follows
> > > > >Starting WebLogic Server ....
> > > > ><Aug 26, 2002 7:14:32 AM PDT> <Notice>
> > <Management>
> 
=== message truncated ===


=====
God Bless America

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to