Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread How to write in server log?
Sun, Jul 3 2011 4:39 PMPermanent Link

Ralf Mimoun

Hi again Smile

When started as a service, the DBISAM server does not show a tray icon (at least in MS Server). Additionally, you end up with tons of AVs until you install the service with "/nointeract". So you have to use SrvAdmin to get any detailed information from the server.

I added a bunch of functionality to the server, and I'd like to show the user what's configured. The best way to do so seems to write these information at startup of the server in the server log, so you can get it from SrvAdmin. All log information seems to be written by the TDataServer.LogEvent. Unfortunately I can't find a proper way to call that method in the dbsvr main.pas. Any ideas?

Oh, I am using DBISAM 4.27 because I can't update all installations to 4.30 and the new BLOB management.

Ralf
Mon, Jul 4 2011 11:09 AMPermanent Link

Raul

Team Elevate Team Elevate

I don't think you can call the server log functions but what you can do is simply write your own entries into the log directly on server (for example on engine start) and then it all becomes part of logfile and can be viewed and remotely retrieved, etc.

Look at ServerEngineServerLogEvent in the dbsrvr project all it basically does is seek to end of file and write the record. So in your case just use a TLogRecord to build your own message and then write it to log file.


procedure TMainForm.ServerEngineServerStart(Sender: TObject);
 var myLog:TLogRecord;
begin
... //leave this as is

myLog.Text := 'my custom log entry';
//mylog.category, etc - fill in other record fields as needed

ServerEngineServerLogEvent(nil,myLog); //log it to log file
end;

Raul
Mon, Jul 4 2011 2:45 PMPermanent Link

Ralf Mimoun

Cool, works like a charm Smile
Image