You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by dh...@orbitech.co.in on 2002/07/16 10:34:51 UTC

Backward compatibility in Loader class

Hi,

I am using Log4j 1.1.3. 

I have used a method of the Loader class from the
org.apache.log4j.helpers package. In this version there was only one
method in the Loader class, namely 

public static URL getResource(String resource, Class clazz)

However in version 1.2.5 the method has the following signature :

public static URL getResource(String resource)

Hence as far as I can see, backward compatibility has been lost in the
latest version. I would like to know whether this is a known change,
since I could not find notification of this change anywhere in the
HISTORY.
 

Regards,

Dhaval Udani
Senior Analyst
M-Line, QPEG
OrbiTech Solutions Ltd.
+91-22-8290019 Extn. 1457



-----Original Message-----
From: Nicole.Gruebel [mailto:Nicole.Gruebel@huk-coburg.de]
Sent: Tuesday, July 16, 2002 1:58 PM
To: log4j-user
Subject: DailyRollingFileAppender & RollingFileAppender don't create
backups


Hi!

I know, these appenders have already been discussed, but I couldn't find
a solution that would work in the archive.

I just want to have an appender that rolls every day (DailyFile) and
creates/saves 1 log-file (DailyLog4J.log) and 1 backup-file.
And I want another appender that rolls when the file-size reaches for
example 5KB (RollingFile) and creates/saves 1 log-file
(RollingLog4J.log) and for example 2 backup-files.
I tried the following configuration ...

<appender name = "DailyFile" class =
"org.apache.log4j.DailyRollingFileAppender">
      <param name = "Threshold" value = "INFO" />
      <param name = "Append" value = "false" />
      <param name = "DatePattern" value = "'.'yyyy-MM-dd" />

      <param name = "File" value =
"o:\\Mp_safir\\umgebung\\Log4J-Test\\DailyLog4J.log" />
      <layout class = "org.apache.log4j.PatternLayout">
            <param name = "ConversionPattern" value = "%d{dd.MM.yyyy
HH:mm:ss} %-5p: [%m]%n" />
      </layout>   
</appender>

<appender name = "RollingFile" class =
"org.apache.log4j.RollingFileAppender">
      <param name = "Append" value = "false" />
      <param name = "maxFileSize" value = "5KB" />
      <param name = "maxBackupIndex" value = "2" /> 
      <param name = "File" value =
"o:\\Mp_safir\\umgebung\\Log4J-Test\\RollingLog4J.log" />
      <layout class = "org.apache.log4j.PatternLayout">
            <param name = "ConversionPattern" value = "%d{dd.MM.yyyy
HH:mm:ss} %-5p: [%m]%n" />
      </layout>   
</appender>

Well, I first didn't have the append-parameter set. No rolling happend
at all.
With append = false I finally get a reaction ... but not a useful one.
The log-files are cleared and the logging continues, but there are no
backup-files created. The strangest thing is that the log-files seem to
be cleared not only at the configured rolling-events (file-size or
date), but everytime a loggin occurs.
I guess this unwanted clearing is caused by the append-parameter, but I
don't have a clue why it is there at all then - it doesn't seem to make
sense to me, when you don't save any of your logging ...
Am I using a wrong configuration for my purpose? I really would
appreciate any advice and/or sample-configurations.
I'm currently still using 1.1.3 - but we'll switch to 1.5.2 soon, if
this can have any influence on this problem.

Thanks!

Nicole Gruebel  

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>