When starting the server, assigned blank to filename (this is necessary otherwise it saves it in the Temp folder).
Hooked the event. Now I can customise the log and filter out unnecessary events. Code here, maybe some of it will help others.
procedure TDBase.monFDOutput
(ASender : TFDMoniClientLinkBase;
const AClassName, AObjName, AMessage : string);
function Logging_This_Class : Boolean;
begin
Result := AClassName = 'TFDConnectionDef';
end;
function Logging_This_Object : Boolean;
begin
Result := (AObjName = 'conFD') and
(Pos('mysql_', AMessage) = 0) and
(Pos('. Create', AMessage) = 0) and
(Pos('. Destroy', AMessage) = 0);
{ Filter out fetched data unless explicitly requested }
if Result and not FLog_Qry_Results
then Result := (Pos('Fetched', AMessage) = 0) and
(Pos('Column [', AMessage) = 0) and
(Pos('EOF', AMessage) = 0);
end;
function Logging_This_Command : Boolean;
begin
Result := (AClassName = 'TFDPhysMySQLCommand') and
(Pos('[Command=', AMessage) > 0) and
(Pos('Table PKey', AMessage) = 0);
end;
function Should_Skip_Log_Line : Boolean;
begin
Result := (Pos('>> Close [', AMessage) > 0) or
(Pos('<< Close [', AMessage) > 0) or
(Pos('>> Unprepare [', AMessage) > 0) or
(Pos('<< Unprepare [', AMessage) > 0) or
(Pos('. Destroy [', AMessage) > 0) or
(Pos('. Column [', AMessage) > 0) or
(Pos('. EOF', AMessage) > 0);
end;
begin
if Logging_This_Class or Logging_This_Object or Logging_This_Command
then if not Should_Skip_Log_Line
then TLogger.Write (AMessage, AObjName);
end;
Well, you can. But the log is a mishmash of styles from the different components contributing to it. I preferred to see it running for a week, before deciding what to remove. Unfortunately some multi-line logs are interleaved between the components. I wanted to log time taken. Since the start and end lines are not sequential, it requires a dictionary storage to track them. I left that for later - I will see what the new size of logs is over the next week.