Appendices > Using Rogue Wave Server on Windows > Controlling Rogue Wave Server Error and Trace Messages > Redirecting Messages to a File
 
Redirecting Messages to a File
Error messages and trace messages can be redirected to a file either at runtime via
the environment variable ILS_LOGFILE or in the application start-up code with a
call to the static method IlsLogfile::SetLogfile.
The signature for the function IlsLogfile::SetLogfile is shown here:
class IlsLogfile {
public:
  ...
  static IlsBoolean SetLogfile(const IlsString&=IlsString::Null,
IlsBoolean logAndOutput=Ilsfalse,
IlsBoolean appendTolog=Ilsfalse);
  ...
};
Calling this function with a file name causes all messages to be written to the file and not to the console or to the text window. Calling the member function with no argument causes all subsequent output to be written to the console or text window. The environment variables ILS_LOGFILE, ILS_LOGFILE_ONLY, and ILS_LOGFILE_APPEND can be used to decide at runtime whether to write trace and error messages to a file. You can refer to the Reference Manual to learn how to set those environment variables depending on how you want messages to be redirected.
The environment variable ILS_LOGFILE supports the substitution of the process identifier for the case where several applications may want to write to different log files simultaneously.
To write to a file using the process identifier as part of the file name, use %PID% in the string to have the process identifier substituted. For example, if the environment variable ILS_LOGFILE is set to lf%PID%.log, then the file name used for a process with identifier 70 would be lf70.log.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.