Presenting HexLog

Tønsberg, Vestfold, Norway 14.10.2016

Quartex Components is proud to present our latest product: HexLog. A journal and log system for Embarcadero Delphi and C++ builder developers. HexLog will be available for the VCL framework and Firemonkey. It supports all platforms including mobile devices (Android and iOS).

Logging vs. journaling

logformatsMost log systems on the market deals with errors. They capture exceptions, performs stack traces and offer ways of delivering this information back to the developer. Delphi developers are blessed with top of the line products, products like Eurekalog and Madexcept. Both these products covers debugging and dealing with exceptions professionally.

HexLog is designed for program-flow logging, also known as journaling. This is where services and applications log their activities regardless. This type of logging is actually a requirement for software delivered to governments and corporations around the world.

Example: The Norwegian government operates with the KITH standard, which is a framework of XML definitions covering hundreds of document, message and data structures. Internationally there are at least seven different frameworks.

One of the requirements of journal-logging is that it should be stored in a format readable by human beings (text, xml, json). The second criteria is that the content, the actual information logged to a journal, should be understandable for non-developers. It should present information that clearly defines what the program is doing, when it was executed and most importantly: why.

xml
Medical software has rigid rules for user activity and program journaling

Get rid of last-minute logging

hexlog_fmxWhen developing system services developers often end up with text file logging. At Quartex Components we have consulted on countless projects the past 10 years, and we have noticed that the majority of developers – even large companies, more often than not end up with a pure “write text to a file” style logging. The worst case being constantly loading, saving a TStringlist.

With a tight deadline and focus on delivering the functionality, logging is often added at the last possible moment. As a result the content of the log and the format in which it is written rarely lives up to standards. Let alone being useful for non developers.

Hexlog and get it right

hexlogAt Quartex Components we take journaling and program-flow logging seriously. Our core journaling component actually gives you advanced features like multi-file storage; meaning that the component will automatically split the log-file into parts in the background. But even though the log consists of many files, you access it like it was a single file.

HexLog is also thread safe, built from the ground up to be accessed by more than one thread. We have also included thread safe value and object envelope classes, designed to make sharing values between threads safe, easy and practical.

Select your format

Hexlog ships with several writer components: text, xml, json and journal. As the names imply the writer is in charge of shaping the output to a specific format. Simply drop the writer component on a form or datamodule and connect it to the central THexLog component, and that’s it!

Abstract storage

Hexlog implements a storage mechanism that is flexible. You can store directly to disk with THexBufferFile, to memory with THexBufferMemory and to zip archives with THexBufferZip.

But perhaps you want to integrate the logging with your backend servers? Simply drop a THexBufferOwner on your form or datamodule and capture 5 simple events. It gives you full control over the data-flow and you can ship the data anywhere you wish.

Multifile API

helpJournaling critical services that performs many tasks means large logs. A typical journal log in the oil-industry is about 1 gigabyte per 24 hour cycle. As you can probably imagine, auditing a one gigabyte text file is not something you want to do. Especially not when the audit is due to a critical system crash and you need to locate the error quickly. With a high-end customer breathing down your neck you really don’t want to jump head first into a file of that size.

To remedy this we developed our multi-file API. Our journal storage component will actually split up the log into pieces, based on the size limitations you set. But you access the log as if it was a single file.

The journal component will calculate offsets, keep track of the files that make up the journal (stored in the journal index file) and do all the grunt-work for you. It actually has more in common with a database engine than a traditional log system.

The components

HexLog includes the following components. It is easy to extend the codebase with your own formats, and through the owner components (THexLogBufferOwner, THexLogWriterOwner) you can easily take charge of how the data looks and where it goes.

  • THexLog
  • THexLogBuffer
    • THexLogBufferMemory
    • THexLogBufferFile
    • THexLogBufferOwner
  • THexLogWriter
    • THexLogWriterXML
    • THexLogWriterJSON
    • THexLogWriterText
    • THexLogWriterJournal
    • THexLogWriterOwner

Protect mechanisms

shieldAs mentioned previously HexLog ships with a unit of generics field and object envelopes. A protection envelope is essentially a thin class wrapper around either an intrinsic datatype or a class instance, where access to the memory or object is automatically handled through classical locking mechanisms.

Using mutexes or critical sections to protect values, especially those shared between threads and processes, is nothing new. But our protection classes simplifies this greatly and also solves it with elegance and ease.

var
LMyValue: TProtectedValue<integer>;

// create an envelope that protects an integer
LMyValue := TProtectedValue<integer>.create;

// You can also define read/write access
LMyValue := TProtectedValue<integer>.create([lvRead]);

// assign a value, read-write locking is handled
// automatically
LMyValue.value := 1200;

// Perform a locked procedure with exclusive access
// to the value
LMyValue.Synchronize( procedure (var data: integer)
  begin
    data := 1200;
  end);

HexLib comes with the following protected envelope classes:

  • TProtectedValue
  • TProtectedObject
  • TProtectedObjectList

By using the envelope classes to protect access, the objects themselves can be shared between threads without any of the problems traditionally associated with multi-threading.

You can also use these envelopes for fields in components to make rock-solid, thread safe controls.

Estimated availability

HexLog will enter its beta phase this month (october 2016) and is estimated to be available for purchase the first week of november 2016.

The price is set to $129 with discounts for teams of 4 developers or more.

One thought on “Presenting HexLog

Comments are closed.