11

I am in need of transaction log library with following features:

  • maximum performance. No force (flush), let O/S write buffers at its own discretion. File size increases in big chunks, to minimize metadata modifications. I don't care if some last records are lost.

    • reading records in backward order (most recent first).

The problem is, how to find the last valid record when reading the log file? What technics can be used, or is there a ready opensource library?

Alexei Kaigorodov
  • 13,189
  • 1
  • 21
  • 38
  • What system do you need the logging for? Are you programming, or installing on top of something else? – Stephen O'Flynn Oct 01 '12 at 07:05
  • The system is dataflow execution engine. Log record types are: task started, task send a message, task ended. – Alexei Kaigorodov Oct 01 '12 at 07:53
  • Since the original poster said "No, this is a debug log library, and I need transactional log, able to reliably write binary data, and allowing to read in backward direction." - I can't help. Sorry. – Stephen O'Flynn Oct 01 '12 at 13:33

2 Answers2

2

Did you check if HOWL - High-speed ObjectWeb Logger matches your requirements? It is rather out of date and seems not to allow random access or reading backward. However, it supports setting a mark and replaying events from a mark on. Because it is open source it might be adaptable to your needs.

You may investigate too if the logging part of JBoss Transaction is suitable.

Please specifiy what you mean with "read backwards" through a transaction log. A transaction log may contain logs from multiple transactions each consisting of a sequence of events.

More information on transaction logging can be found here (and on the web of course):

  • Java Transaction Processing: Design and Implementation (ISBN 978-0130352903)
  • Fundamentals of Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery (ISBN 978-1558605084)
  • Principles of Transaction Processing (ISBN 978-1558606234)
  • and in various books about database system concepts

Hope this helps a bit to come closer to your goal

Michael

Claude
  • 1,724
  • 3
  • 17
  • 46
  • "read backwards" means ability to read the last transaction record, without scanning from the log start. The order of reading events does not matter - there will be expected small number. – Alexei Kaigorodov Jun 13 '13 at 09:50
-3

Most of the famous logging systems (like log4j and apache) support different kind of logging mechanisems, you just have to config them right. But, if you want to log backward, it is really resource consuming, because streams are sequential and you should push a new record into top of all the other records. Also probably you should do most of the logging code by yourself.

Milad
  • 89
  • 1
  • 8