logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Watts <...@cliftonfarm.org>
Subject Re: How to delete individual entries from a log file
Date Thu, 15 Dec 2011 08:32:33 GMT
I'll try to refrain from chastising you for using a log as a work
queue... :-)

but I suppose the "cleanest" way would be to log to a database and then
delete those rows once the files have been indexed.

Alternatively, if that adds too many moving parts and you want to stick
with text files, leave a space in the log records and rewrite them with
a marker (e.g. "*") in that space once the files have be indexed to mark
them as "deleted" or "handled" as the case may be.

On Thu, 2011-12-15 at 08:59 +0100, Michael Wechner wrote:
> Hi
> As some of you might now Apache Lucene creates a "write.lock" when an 
> IndexWriter is updating the index,
> hence it can happen that another IndexWriter (inside another thread) 
> won't be able to update the same index at the same time and based on a 
> specific timeout something might not get indexed.
> We are currently logging all such instances when something does not get 
> indexed.
> Now based on that log file, containing hints re files which have not 
> been indexed yet, we would like to introduce
> a process starting to re-index these specific files and if successful, 
> then we would like to remove the corresponding particular entry from the 
> log file.
> I understand that log4j might not be intended for such a usecase and 
> maybe we shouldn't try to misuse it, but I would appreciate any pointers 
> or ideas or alternatives.
> Thanks
> Michael
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message