Show/Hide Toolbars

How to Implement Server Scripting and Logging With FVTerm

Navigation: » No topics above this level «

Log File name Management in Inventu Viewer+ ASP.NET Solutions

Scroll Prev Top Next More

If you are an emulation-only developer, please ignore this section. Log file names in emulation environments are named using web.config.

 

This section is for developers that have created a Inventu Viewer+ Screen Integration application with Inventu Viewer+ Studio--either a Web Services solution or Web UI solution, where new sessions are created in the solution framework rather than by a user connection to the FVTerm application.

 

There is a special method in the TaskSession.cs web service module for managing the name of the log files.  This is a good place to also set the name of the log file so that the FVTerm web emulator logging functions can log to the same file as the web service (for each session).

 

Customizing the Log File Names

 

It is possible to customize the Log file names using any of the credentials used in logging on, or some other customization--in the following sample, the active "Userid" logon field value is being used for the log file instead of "Users".  The name of the application / web service project can also be used:

 

 void DebugFactory(IOBag ioBag)

 {

         System.DateTime dt=System.DateTime.Now;

         Dbg=new Debug(null,String.Format("{0}_{1}_{2,-14:HH:mm:ss:fff}",

                 ioBag[FieldID.Userid],dt.ToShortDateString(),dt));

         this.oConn.owner = Dbg.LogFileName;

 }

 

Setup for the FVTerm Log File Name

 

The logging functionality in the FVTerm internal services will utilize the active session's HostConnection object "owner" property as the name of the log file.  As such, it is imperative that this value be set during initialization of the web service's session in order to have unique log file names (otherwise, all FVTerm logging will go to the ".NET.log" file).  This is achieved in the above example with the line:

 

         this.oConn.owner = Dbg.LogFileName;