Hi,

I have a test set up that logs and also the class under test logs too.

I want to turn of logging at times but am finding that the console
ALWAYS logs INFO messages of the loggers being created (my user defined
log entries are not displayed).

I've tried various settings in the property file but I just cannot stop
these entries going to the console.

Here's my property file:

log4j.rootLogger=OFF, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#log4j.appender.R=org.apache.log4j.FileAppender
log4j.appender.R.File=app.log

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p %c - %m%n

# Vary level for packages
log4j.logger.org.springframework=ERROR

And here's the bit of my initialisation code in my Junit setUp:

protected void setUp() throws Exception {
 
PropertyConfigurator.configure("c:/Projects/FETServer/conf/log4j.propert
ies");
                    // initialise datasource
                    _logger.info("One-time setUp()");
                    _logger.info("intializing connection...");
                    dataSource = new SingleConnectionDataSource();
                    dataSource.setDriverClassName(
                        "oracle.jdbc.driver.OracleDriver");
                    dataSource.setUrl(
                        "jdbc:oracle:thin:@132.25.50.69:1521:ORCL01");
                    dataSource.setUsername("scott");
                    dataSource.setPassword("tiger");

                    dao = new SampleDao(dataSource);
                }

And here's whats going to the console:

*** configurationOptionStr=null
** End of LogManager static initializer
log4j:INFO Creating new logger [com.amex.ifst.fet.dao.TestSampleDao] in
repository [default].
log4j:INFO Creating new logger [org.apache.log4j] in repository
[default].
log4j:INFO Creating new logger [org.apache.log4j.PropertyConfigurator]
in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Creating new logger [org.apache.log4j.config.PropertySetter]
in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Creating new logger
[org.apache.log4j.helpers.OptionConverter] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Creating new logger [org.springframework] in repository
[default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger
[org.apache.log4j.PropertyConfigurator] in repository [default].
log4j:INFO Returning existing logger [org.apache.log4j] in repository
[default].
log4j:INFO Creating new logger
[org.springframework.jdbc.datasource.SingleConnectionDataSource] in
repository [default].
log4j:INFO Creating new logger [com.amex.ifst.fet.dao.SampleDao] in
repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.core.JdbcTemplate] in repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.datasource.DataSourceUtils] in repository
[default].
log4j:INFO Creating new logger
[org.springframework.transaction.support.TransactionSynchronizationManag
er] in repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.support.JdbcUtils] in repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] in
repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.support.SQLStateSQLExceptionTranslator] in
repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.support.SQLErrorCodesFactory] in repository
[default].
log4j:INFO Creating new logger
[org.springframework.beans.factory.support.DefaultListableBeanFactory]
in repository [default].
log4j:INFO Creating new logger
[org.springframework.beans.factory.support.CglibSubclassingInstantiation
Strategy] in repository [default].
log4j:INFO Creating new logger
[org.springframework.beans.factory.xml.XmlBeanDefinitionReader] in
repository [default].
log4j:INFO Creating new logger
[org.springframework.core.io.support.PathMatchingResourcePatternResolver
] in repository [default].
log4j:INFO Creating new logger
[org.springframework.beans.factory.xml.ResourceEntityResolver] in
repository [default].
log4j:INFO Creating new logger
[org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser]
in repository [default].
log4j:INFO Creating new logger
[org.springframework.core.CollectionFactory] in repository [default].
log4j:INFO Creating new logger
[org.springframework.beans.BeanWrapperImpl] in repository [default].
log4j:INFO Creating new logger
[org.springframework.core.io.AbstractPathResolvingPropertyEditor] in
repository [default].
log4j:INFO Creating new logger
[org.springframework.beans.CachedIntrospectionResults] in repository
[default].
log4j:INFO Creating new logger
[org.springframework.beans.factory.support.BeanDefinitionValueResolver]
in repository [default].
log4j:INFO Creating new logger
[com.amex.ifst.fet.dao.OracleStoredFunction] in repository [default].
log4j:INFO Returning existing logger
[com.amex.ifst.fet.dao.OracleStoredFunction] in repository [default].
log4j:INFO Creating new logger
[org.springframework.jdbc.core.StatementCreatorUtils] in repository
[default].

Rakesh Patel
Project Architect
IFST
Tel: +44 (0)20 7153 4243
Fax: +44 (0)20 7153 4153
Mobile: +44 (0) 7921 582573


American Express Investments and American Express Independent Financial 
Advisers are marketing names for American Express Financial Services Europe 
Limited, a separate corporation within the American Express group of companies. 
 American Express Financial Services Europe Limited is authorised and regulated 
by, and is entered into the register (No. 190853 www.fsa.gov.uk/register/) of, 
the Financial Services Authority and a member of the London Stock Exchange. 
Registered in England No. 3614902. Registered address: 230 Blackfriars Road, 
London SE1 8NW. Vat No. 740 4143 68. 

The information in this email and any attachments is confidential and intended 
solely for the attention and use of the named addressee(s). It may be subject 
to legal, professional or other privilege and further distribution of it is 
strictly prohibited without our authority.  If you are not the intended 
recipient, you are not authorised to and must not disclose, copy, distribute, 
or retain this message or any part of it, and should notify us immediately.


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

Reply via email to