I have a working program with TMSlogging and wanted to add Aureliuslogging.
I have created a table and supplied my IDBConnectionPool to the logging.
The code is about the same as in the manual:
uses
Aurelius.Drivers.Interfaces,
.
.
var
Pool: IDBConnectionPool;
.
.
TMSLogger.RegisterOutputHandlerClass(TTMSLoggerAureliusOutputHandler, [Pool]);
When I compile this code I get an error:
[dcc64 Error] program.pas(224): E2250 There is no overloaded version of 'RegisterOutputHandlerClass' that can be called with these arguments
What's wrong?
Hi,
You can convert the pool via TValue.From:
TMSLogger.RegisterOutputHandlerClass(TTMSLoggerAureliusOutputHandler, [TValue.From<IDBConnectionPool>(Pool)]);
Pieter Scheldeman2016-10-11 13:49:12
Maybe it's an idea to correct that in the manual, and maybe with a little example. The manual states:
TTMSLoggerAureliusOutputHandler (unit TMSLoggingAureliusOutputHandler)
The TTMSLoggerAureliusOutputHandler connects via an IDBConnectionPool to send logging
outputs to a dataset connected via Aurelius. The process of setting up a connection is simple
as demonstrated in the code below.
TMSLogger.RegisterOutputHandlerClass(TTMSLoggerAureliusOutputHandler,
[pool]);
and I believe that's exactly what I did.
I also had to find out the hard way what the table in the database must look like.
For other who read this: in PostgreSQL the sequence and table look like this:
CREATE SEQUENCE seq_tmslog_data START 1;
CREATE TABLE tmslog_data (
Id INTEGER NOT NULL DEFAULT nextval('seq_tmslog_data'::regclass),
Name TEXT,
Time_Stamp TEXT,
Process_ID TEXT,
Thread_ID TEXT,
Memory_Usage TEXT,
Log_Level TEXT,
Value TEXT,
Log_Type TEXT,
CONSTRAINT tmslog_data_id PRIMARY KEY (Id)
);
Hi,
We have applied a fix in the manual.
Logging to an Aurelius table does not supply the log_level, which is very inconvenient as it is the main criterium to search for problems.
It would also be very handy if there was a way to supply plain values to the Aurelius table (as they are in different columns) and formatted values to the text-outputs. Ideally the values could have a non-text format when they are non-text (e.g. process_id, thread_id, memory_usage, time_stamp), which is much more powerful in a database. At the moment I can only get formatted text, cut into pieces, in a table, not very handy.
You're correct about this. We'll look to extend to add log level and use native data type instead of putting it as string.