The Component Enabler client side log is enabled using code in the form shown below. In this example LogFile is a string variable that contains the name of the file to be created. LogLevel contains an integer variable that is a value in the range one to seven, to indicate the level of logging performed. It is recommended that you set this to seven (the most verbose logging level).
The logging information is written to the default output device. This varies depending on the environment in which you are running Component Enabler. For example, if you are running as an applet in a browser, logging is written to the Java console of the browser. If you are running from a .bat file, the DOS box is used as the default output device.
In situations where there is no apparent default output device, such as when accessing a COM object, you can duplicate the logging information into a file, using the setOutputFile() method.
Note: You should call this method against the 'def ' attribute of the Log object, for example, Def.setOutputFile.
Dim mvarLogObject As Object ’Create the Log object On Error Resume Next Set mvarLogObject = CreateObject("Log.java.1") ’Exit if we have a problem If Err.Number <> 0 Then MsgBox "Cannot create log object - " + Err.Description Exit Sub End If ’Open the log file mvarLogObject.def.setOutputFile (LogFile) ’Set the logging level mvarLogObject.def.setLogLevel (LogLevel) ’Set the detail level mvarLogObject.def.setFlags (30)