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 rs...@chubb.com on 2001/10/19 16:18:12 UTC

ExternallyRolledFileAppender

I have got this working with the following configuration:

# Setup AppEvents category
log4j.category.AppEvents=DEBUG,  AppEventsExt
....
# Setup app_events_ext.log appender
log4j.appender.AppEventsExt=org.apache.log4j.varia.ExternallyRolledFileAppender
log4j.appender.AppEventsExt.File=app_events_ext.log
log4j.appender.AppEventsExt.Port=64011
log4j.appender.AppEventsExt.layout=org.apache.log4j.PatternLayout
log4j.appender.AppEventsExt.layout.ConversionPattern=%d %c %p %m%n
log4j.appender.AppEventsExt.DatePattern='.'yyyy-MM-dd

I get a warning upon init of Log4J:
log4j:WARN No such property [datePattern] in
org.apache.log4j.varia.ExternallyRolledFileAppender.

I would have expected ExternallyRolledFileAppender to take a datePattern
like DailyRollingFileAppender, so that every invocation of 'Roller' would
create a back-up file with a given date/time pattern in the name. Bummer.

Anyway, I used the 'Roller' sample program to fire off the roll - no
problem.  It creates the file 'app_events_ext.log.1'.

However, subsequent invocations of 'Roller' don't seem to do anything, as
far as I can tell. At least I would have expected subsequent invocations of
'Roller' to have created 'app_events_ext.log.2', app_events_ext.log.3',
etc.

Is there a way to get ExternallyRolledFileAppender to create a different
named file upon subsequent invocations, like DailyRollingFileAppender,
without writing it myself?

I looked thru the API, in USENET, and in the archive of this mailing list,
but don't see any other references to setup and usage of
ExternallyRolledFileAppender, or anyone discussing its use. I don't use
DailyRollingFileAppender, because it doesn't always roll our files
precisely at midnite.  I want to have cron invoke 'Roller' at midnite,  or
whenever, so I can control exactly when our files are archived.

---------------------------------------------------
Ronald Signorino
ChubbGroupOfInsuranceCompanies
rsignorino@chubb.com
---------------------------------------------------



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


RE: ExternallyRolledFileAppender

Posted by David Schultz <ds...@atstransportation.com>.
It's not an extension of DailyRolledFileAppender, so why would you expect it
to behave like one?

Try setting a MaxBackupIndex (according to the Javadoc on
RollingFileAppender, the default is 1):

log4j.appender.AppEventsExt.MaxBackupIndex=100

-----Original Message-----
From: rsignorino@chubb.com [mailto:rsignorino@chubb.com]
Sent: Friday, 19.October 2001 10:18
To: log4j-user@jakarta.apache.org
Subject: ExternallyRolledFileAppender


I have got this working with the following configuration:

# Setup AppEvents category
log4j.category.AppEvents=DEBUG,  AppEventsExt
....
# Setup app_events_ext.log appender
log4j.appender.AppEventsExt=org.apache.log4j.varia.ExternallyRolledFileAppen
der
log4j.appender.AppEventsExt.File=app_events_ext.log
log4j.appender.AppEventsExt.Port=64011
log4j.appender.AppEventsExt.layout=org.apache.log4j.PatternLayout
log4j.appender.AppEventsExt.layout.ConversionPattern=%d %c %p %m%n
log4j.appender.AppEventsExt.DatePattern='.'yyyy-MM-dd

I get a warning upon init of Log4J:
log4j:WARN No such property [datePattern] in
org.apache.log4j.varia.ExternallyRolledFileAppender.

I would have expected ExternallyRolledFileAppender to take a datePattern
like DailyRollingFileAppender, so that every invocation of 'Roller' would
create a back-up file with a given date/time pattern in the name. Bummer.

Anyway, I used the 'Roller' sample program to fire off the roll - no
problem.  It creates the file 'app_events_ext.log.1'.

However, subsequent invocations of 'Roller' don't seem to do anything, as
far as I can tell. At least I would have expected subsequent invocations of
'Roller' to have created 'app_events_ext.log.2', app_events_ext.log.3',
etc.

Is there a way to get ExternallyRolledFileAppender to create a different
named file upon subsequent invocations, like DailyRollingFileAppender,
without writing it myself?

I looked thru the API, in USENET, and in the archive of this mailing list,
but don't see any other references to setup and usage of
ExternallyRolledFileAppender, or anyone discussing its use. I don't use
DailyRollingFileAppender, because it doesn't always roll our files
precisely at midnite.  I want to have cron invoke 'Roller' at midnite,  or
whenever, so I can control exactly when our files are archived.

---------------------------------------------------
Ronald Signorino
ChubbGroupOfInsuranceCompanies
rsignorino@chubb.com
---------------------------------------------------



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



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