![]() |
AW: Spring4D Logging
Zitat:
Bis bald... Thomas |
AW: Spring4D Logging
Zitat:
Danke Übrigens sorry dem Threadersteller für das kapern dieses Threads. Eigentlich gings ja um Spring4D... Gruss Werner |
AW: Spring4D Logging
Liste der Anhänge anzeigen (Anzahl: 1)
Zitat:
Delphi-Quellcode:
Durch diesen Aufruf
unit u_RemoteLogging;
interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.UITypes, System.Classes, mormot.core.base, mormot.core.text, mormot.core.rtti, mormot.core.log; type TRemoteLogging = class(TComponent) strict private FLogClass: TSynLogClass; protected const DEFAULT_PORT = 8091; public destructor Destroy; override; procedure Start(pmLogClass: TSynLogClass; const pmcUri: RawUtf8 = '127.0.0.1/LogService'); end; implementation uses mormot.net.sock, mormot.rest.http.client; //============================================================================== // TRemoteLogging //============================================================================== destructor TRemoteLogging.Destroy; begin if FLogClass <> Nil then FLogClass.Family.EchoRemoteStop; inherited Destroy; end; procedure TRemoteLogging.Start(pmLogClass: TSynLogClass; const pmcUri: RawUtf8); var uri: TUri; begin if pmLogClass <> Nil then try FLogClass := pmLogClass; uri.From(pmcUri, Int32ToUtf8(DEFAULT_PORT)); TRestHttpsClient.CreateForRemoteLogging(uri.Server, pmLogClass, Utf8ToInteger(uri.Port), uri.Root); except on E: Exception do pmLogClass.Add.Log(sllError, E); end; end; end.
Delphi-Quellcode:
bindest du sie ins Programm ein und kannst danach den Einträgen im LogView folgen.
TRemoteLogging.Create(Self).Start(TSynLog);
PS: Für dein Programm verwendest du mORMot2. Nur zur Erstellung des Programms Synopse LogView benötigst du zur Zeit noch mORMot1. Bis bald... Thomas |
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz