logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Geir.Ovst...@dnv.com>
Subject RE: RollingFileAppender but keeping some data
Date Fri, 11 Dec 2009 14:58:37 GMT
Tobias,

I my opinion what you are doing is maybe mixing two issues that should be kept separate:

	The generation of events
	The storages of such events in an underlying storage mechanism	
	The operational use of events in a GUI

Maybe you should consider using a database appender and have the GUI query your database according
to the operational needs of the GUI operator where time would be part of the query.

/Geir

-----Original Message-----
From: Habermann, Tobias [mailto:T.Habermann@gsi.de] 
Sent: 11. desember 2009 15:00
To: log4j-user@logging.apache.org
Subject: RollingFileAppender but keeping some data

Hi
I am using log4j in a Controlsystem GUI to log different hardware states (e.g. temperatures,
pressure, etc.). The user needs to have access to = the data from the last 4 days always.
To display the data I read it from = the logfiles. Right now I use a simple FileAppender.
But after some time = the files get very big. I would like to have something like a = RollingFileAppender
that archives the log file but instead of starting a = new File, it should always keep the
data from the last 4 days in the file.=20 Maybe I should mention that I am not a java expert.=20
Is there a simple way to implement this?=20 Should I overwrite the RollingFileAppender.rollOver()
?
Or should I stay with the FileAppender and write an independent class = that opens the logfile
and removes any entries that are older than 4 = days?


Regards
Tobias Habermann

-- 
GSI Helmholtzzentrum für Schwerionenforschung GmbH
Planckstraße 1
D-64291 Darmstadt
www.gsi.de
Gesellschaft mit beschränkter Haftung
Sitz der Gesellschaft: Darmstadt
Handelsregister: Amtsgericht Darmstadt, HRB 1528

Geschäftsführung: Professor Dr. Dr. h.c. Horst Stöcker, Christiane Neumann

Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph
Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt



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



**************************************************************************************The
contents of this e-mail message and any attachments are confidential and are intended solely
for the addressee. If you have received this transmission in error, please immediately notify
the sender by return e-mail and delete this message and its attachments. Any unauthorized
use, copying or dissemination of this transmission is prohibited. Neither the confidentiality
nor the integrity of this message can be vouched for following transmission on the Internet.**************************************************************************************



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


Mime
View raw message