------------ ipLogger.exe ------------ Version 1.02 / 20 Feb 2004 -------------------------------- 0. History Changes in 1.02: - new "useSystemTime" global .ini parameter was added; - UDP logger will now check the creation time of log file, and will remove it, if it was created in a different month or year; - new "scanCRLF" parameter was added to the TCP logger component; - several Win98/ME compatibilty issues were fixed. -------------------------------- 1. running modes Windows NT/2K/XP/2003 : either as service, or as console application. Windows 95/98/ME : console mode only Tested on: // W95 console : not tested W98 console : OK ME console : OK // NT 4.0 service : OK NT 4.0 console : OK W2K service : OK W2K console : OK XP service : OK XP console : OK 2003 service : OK 2003 console : OK -------------------------------- 2. install/uninstall/start/stop * To install this application as service, run it once with /install switch. >ipLogger.exe /install Make sure it was not installed as a service before (see uninstall). * To uninstall this application from services, run it once with /uninstall switch: >ipLogger.exe /uninstall * Use Service Manager to start/stop the "IP Logger" service, or run this application with /start or /stop switch to activate or shutdown the application: >ipLogger.exe /start >ipLogger.exe /stop * To suppress output messages, in addition use /q switch: >ipLogger.exe /q /install >ipLogger.exe /q /start * To run this application in console mode rather than as service under WinNT/2K/XP/2003, use the /win95 switch: >ipLogger.exe /win95 A console window will be created, where application's output will be directed. Press ENTER inside this console window to exit application normally. --------------------------- 3. Main configuration file. When started, application opens the main configuration file, which should be located in the same directory as main .exe file, and named the same but with .ini extension. You will find a sample ipLogger.ini file in this archive. Please read it carefully. It contains all vital configuration details. The content of .ini file could be changed at any time. Application will re-read it periodically, and apply the changes as neccessary (new components will be started, or some components will be removed, and new configuration parameters will be applied as needed). NOTE: since application can re-read the .ini file at any time, make sure you made ALL REQUIRED CHANGES AT ONCE. The best way to ensure this is by editing a copy of main .ini file, and then overwriting the main .ini file with new copy. Or, simply stop the application, make required changes and start it again. All timestamps could be in UTC (Coordinated Universal Time) or local time. Refer to the useSystemTime parameter in the main .ini file. --------------------------- 4. Main log file. Application writes some output diagnostic messages to main log file. The name of this file could be configured in the main .ini file. The level (amount) of diagnostic messages could be also specified in the .ini file. When running in console mode, same messages are also written into console window. -------------- 5. Components. There are three supoprted types of components: 1) UDP logger 2) TCP logger 3) File Rename thread It is possible to spawn virtually unlimited number of components of any type. You can do so by specifying the number of required components of each type in main .ini file. ------------- 1) UDP logger This component listens for UDP packets on specified port number and stores them in specified log file, in order of appearance. The name of log file can include the day number, so each day a new log file will be created. Old log files (which was created in different month or year) will be removed. The format of messages written to UDP log file could be configured in the main .ini file. ------------- 2) TCP logger This components listens for new TCP connections on a specifed port number. Once new connection is established, a server's reply is sent to remote peer. The format of reply to send could be configured in the main .ini file. After that, the component will store all data received from remote side in local temporary file. THE CRLF SCAN FEATURE: ON) scanCRLF .ini file parameter = 1 It also scans for CR (13) or LR (10) characters from the beginning of remote data, and once any of this characters is found, it is assumed the "first line" is received. (If CR was found, followed by LF, both characters will be assigned to the "first line"). Then the "first line" is added to TCP log file (as %data% part of log line format), and is removed from local storage. Any data received from the socket after the "first line" will be appended to the end of local file. OFF) scanCRLF .ini file parameter = 0 No CRLF scan is performed, and all data received from the socket is simply appended to the end of local file. "CRLF SCAN IS DISABLED" will be added to TCP log file (as %data% part of log line format). Once remote connection is closed (client must initiate a disconnection), local file will be closed, and its content will be appended to the "common file" as follows: - an attempt will be made to lock the "common file" several times within a few seconds; - if locking was not possible within this time, the component will give up, and should try to do this later again (not implemented in this version); - if file was locked (or created) successfully, local content will be added to the end of the file, file will be unlocked and local temporary storage will be removed. The name of the "common file" can be configured in the main .ini file. --------------------- 3) File Rename thread This component has a configurable interval, and will execute the following sequence periodically: - an attempt will be made to lock the source file; - if locking was not possible within 2 seconds, the component will give up and will try the same sequence again later; - if source file was locked successfully (file must exists), it will be renamed (moved) to the destination file; - it is assured that no other proccess can access the source file while it is locked; After that the component will sleep for specified interval and repeat the sequence again. Both source and destination file names could be configured in the main .ini file. -------------------------------- 6. sources Sources of main application and components implementation are included just for reference. That is not a full sources, general utility functions, sockets implementation and some other classes are missing. -------------------------------- 7. support support@lakeofsoft.com