You are not logged in.
Pages: 1
For debugging purposes, it could be very handy to output the logging content to a console window. It enables interactive debugging of a Client-Server process, for instance: you can interact with the Client, then look in real time at the server console window, and inspect which requests are processed, without the need to open the log file.
The EchoToConsole property enable you to select which events are to be echoed on the console (perhaps you expect only errors to appear, for instance).
with TSQLLog.Family do begin
Level := LOG_VERBOSE;
EchoToConsole := LOG_VERBOSE; // log all events to the console
end;
Depending on the events, colors will be used to write the corresponding information. Errors will be displayed as light red, for instance.
Note that this echoing process slow down the logging process a lot, since it is currently implemented in a blocking mode, and flushes each row to the log file. This feature is therefore disabled by default, and not to be enabled on a production server, but only to make interactive debugging easier.
Online
I am trying to use EchoToConsole in a new application, but I am getting AVs no matter what events I log. I have also run the demos where services can be run as console and get the same result.
The AV occurs with the first call to TSynLog.Add.Log I call. When calling the LogHeaderLock in the LogInternal (line 40753), it then calls LogFileHeader which adds all the header information and then calls Flush (line 40596). This causes the AV on the line: inc(fTotalFileSize,fStream.Write(fTempBuf^,L)); because FStream is nil.
Offline
Looking at Sample 14 and your example above I see it is using TSQLLog.Family.EchoToConsole whereas I was using TSynLog.Family.EchoToConsole which gives the AV. Should I be using TSQLLog.Family and TSQLLog.Add rather the TSynLog by default ?
Offline
Pages: 1