logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: Unable to configure RollingAppender on Intel
Date Wed, 05 Jun 2002 10:33:41 GMT

What a coincidence. Patricia (Pat) Guimaraes contacted me just
yesterday with a similar problem.

First, here are the standard questions:

1) Which version of the JDK are you using?
2) What platform. (OK, you already answered this one.)
3) Which version of Tomcat? Are the Tomcat versions the same on
Solaris and NT?
4) Which version of log4j? Are the log4j versions the same on Solaris
and NT?

The warning message you quote is new to me. I mean this one:

log4j:WARN Failed to set property [file] to value "c:/mylog.log". object is not
an instance of declaring class

Although I have my suspicions, the meaning of "object is not an
instance of declaring class" is not very clear.

To get a better idea, I would like you to modify the
setProperty(String name, String value) method in
src/java/org/apache/log4j/config/PropertySetter.java

  public
   void setProperty(String name, String value) {

     [snip]
     } else {
       try {
         setProperty(prop, name, value);
       } catch (PropertySetterException ex) {
          // before: LogLog.warn("Failed to set property [" + name +
          // before:     "] to value \"" + value + "\". " + ex.getMessage());
          // new:
          LogLog.warn("Failed to set property [" + name +
                     "] to value \"" + value + "\". ", ex);
       }
     }
   }

Compiling log4j is very easy. Download log4j version 1.2.3 from the
log4j site. Unzip it somewhere. Next, you will need is a recent
version of jakarta-ant.  Executing the command "ant jar" from the
log4j home directory should create a new jar file called
log4j-1.2.3.jar in the directory dist/lib/. This jar will not contain
support for JMX, JMS, SMTP etc. which are not necessary for our
purposes.

We can start hunting for the problem once we see the new error
message.  Shout if you need help with compiling log4j.

At 11:02 05.06.2002 +0100, Chris.Goodall@ubsw.com wrote:
>Hi,
>I've got a weird problem on Win 2000/Tomcat config which *does* work under 
>Solaris.
>
>I'm using the following config file :
>
># logging DEBUG level and up - using appender 'fileout' to handle all output
>log4j.rootLogger=debug, fileout
>
># this appender uses an output file
>log4j.appender.fileout=org.apache.log4j.RollingFileAppender
>log4j.appender.fileout.File=c:/mylog.log
>
>log4j.appender.fileout.MaxFileSize=10000KB
># Keep one backup file
>log4j.appender.fileout.MaxBackupIndex=1
>
>log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
># output will look something like:
># <date>     <time>       <thread> <log level>  <class log
msg has 
>originated from>    <msg>
># 2002-05-21 13:05:18,341 
>[jcp-2]  INFO         db.DatabaseServices                  - Database 
>properties loaded.
>log4j.appender.fileout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
>
>
>which is passed into Tomcat as:
>
>set CATALINA_OPTS=%CATALINA_OPTS% "-Dlog4j.configuration=logging.properties"
>
>and console logging:
>
>log4j:WARN Failed to set property [file] to value "c:/mylog.log". object 
>is not
>an instance of declaring class
>log4j:WARN Failed to set property [maxBackupIndex] to value "1". object is 
>not a
>n instance of declaring class
>log4j:WARN Failed to set property [maxFileSize] to value "10000KB". object 
>is no
>t an instance of declaring class
>log4j:WARN File option not set for appender [fileout].
>log4j:WARN Are you using FileAppender instead of ConsoleAppender?
>log4j:ERROR No output stream or file set for the appender named [fileout].
>
>The logging.properties file is being found by the classloader - however, 
>some config problems - any ideas?
>
>Thanks in advance, Chris.

--
Ceki

SUICIDE BOMBING - A CRIME AGAINST HUMANITY
Sign the petition: http://www.petitiononline.com/1234567b
I am signatory number 22106. What is your number?


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message