LogFile

          Class 
          Member of  ScriptUtils Use LogFile object 

Description
Hi-performance text file logging for ASP and ASP.Net, VBScript, VBA, VB5/6, VB and C# applications. Lets you create daily/weekly/monthly log files with variable number of logged values and extra timing and performance info.
  • Hi-performance text file logging from ASP, VBScript or JScript, ASP.Net VB, C#, VBA5 or VBA6.
  • Free-threaded object, can be placed to Application scope
  • Lets you log exact script timing values (up to microsecond or nanosecond), process and thread info and performance values (see LogLineBeginTypes, LineBegin)
  • Writes one or more (any number) string, numeric, date, object (default property), array and other variables with one row of code to the log (Log)
  • Daily/weekly/monthly log filename scheme, lets you specify common log file header and log field names in each file.

Other features

Performance notes and comparison with FileSystemObject and its use to do log files in ASP.
How to create and use LogFile class in ASP, VBS and VBA (VB, Excel, Word, ..)
Methods
Close Closes the log file.
Log Lets you write variant number of values as one log line to the log file.
LogLine Write string as one line to the log file.
Open Opens the log file for write.
Properties
ArraySeparator Separator of values in an array.
String, RW
DateTimeFormat Defines format for the DateTime fields.
String, RW
Encode Encoding of logged values. No encoding or URL encode.
LogLineEncodes, RW
FieldSeparator Separator of logged values. This property is used to separate values on beggining of line and values from Log method.
String, RW
FieldsHeaders Description of additional fields in the log file.
String, RW
FileBegin Comment on the beggining of the log file.
String, RW
LineBegin Defines fields on a begin of the log line.
LogLineBeginTypes, RW
TemplateFileName Full template for log path and file name. The template can contains special tags to specify filename for each day/week/month.
String, RW
FileName Full path and name of the current log file.
String, RO
IsOpen Returns True if the log file is open.
Boolean, RO
LocalDateTime Specicifies if Logal or Global (GMT) date and time is logged.
Boolean, RO
Examples
 LogFile - Simple log file sample  
  Dim LogFile 

  'Create LogFile object
  Set LogFile = CreateObject("ScriptUtils.LogFile")
  LogFile.TemplateFileName = "D:\LogFiles\LG%y%m%d.LOG"

  'Write one string to the log file
  LogFile.LogLine "some line to the log file."

  'Write more values to the log file
  LogFile.Log "Some", "String", "Or", "Numeric", 25, "Values"
  Other links for LogFile class
ScriptUtilities and Huge ASP file upload classes
      Easy to use, hi-performance ASP file upload component with progress bar indicator. Let's you upload multiple files with size up to 2GB to a disk or database along with another form fields. Works with large posts, any character set (including unicode utf-8). Contains one-click multiple files/folders download with on-the-fly compression (Using BinaryWrite/BinaryRead).
      Hi-performance text file logging for ASP/VBScript/VBA applications. Lets you create daily/weekly/monthly log files with variable number of logged values and extra timing and performance info.
       Lets you work with safearray binary data in VBS/JS. It also enables conversion between binary and String data using several code pages. ZLib compress and uncompress functions. Lets you transfer files using compressed stream from a client to server using IE.
      This library also enables calling of some Kernel and Advapi functions (performance, timing, sleep, configuration ...) and enables native work with INI files.

  Additional notes
     LogFile is a COM class specially designed as a free-threaded, hi-performance logging object in Application scope of ASP/ASP.Net pages. It also works with other script engines in VB Script and JScript (ASP, ASP.Net, WSH, CHM, HTA), VB Net, Visual basic (VBA - VB 5, VB 6, Word, Excel, Access, …), C#, J#, C++, ASP, ASP.Net, Delphi and with T-SQL OLE functions - see Use ByteArray object article. You can also use the object in other programming environments with COM support, such is PowerBuilder.
     Source code for LogFile is available within distribution license, please see License page for ScriptUtilities and Huge ASP file upload.

© 1996 – 2005 Motobit Software, help{at}pstruh.cz, help v. 2.16.14