AGG Software
Ask a question  Top  Previous  Next

Log rotation

The main function of Advanced PBX Data Logger is logging data to a file (so-called, log file). The "Log rotation" tab has a rich set of options for it. (fig.8).

 

options logformat

Fig.8. Log-file forming modes.

 

First of all, select log file what you can configure:

 

Log file for data received - all data received will be saved here.
Log file for data sent - all data sent will be saved here. If you want to save data to the same file, as data received, then select the "Log file rotation for data sent" from the list and enable two options: "Create log files on disk" and "Write to log for data received". Yes, of course, you should configure a log rotation for data received before.

 

later, set the "Create log file on disk" option to checked state. Then you can set path to folder, where files will be created with the help of dialog window, which will be showed up after clicking a button with picture of opening folder. You should select a necessary folder in the dialog window and click the "OK" button.

 

Note: The program can work with network paths too, but in this mode, the program will increase data flow over a network and can be failed with exceptional errors.

 

A log file name can be stamped with date and time. In this case a new log file is created periodically. The time stamp format depends on the selected period. For instance, if the "File name prefix" field is set to "sample", the "File extension" field to "log" and the "File name format" option is "Daily", then each log file created will have the format "sampleYYYYMMDD.log". On March 21st, 2003, the log file will be "sample20030321.log". Please, note, that the final extension (after the final period), remains at the end of the file name.

 

Log rotation mode is defined by the following key parameters:

 

File name prefix - text string, which will be added at file name beginning;
File name extension - text string, which will be a file extension (characters after dot);
Log file limit size - the "Limit size" field specify the maximum size in kilobytes of any log file. If you'll specify zero size, then the file size will not limited. Otherwise, if the log file size will exceed the limit specified, then the log file content will be deleted and file filling will start from beginning.

 

If the program works continuous for a long time, it is possible that the log file will have large size and this file will be inconvenient for looking and analysing. For this there is the possibility to create files in dependence with the time on PC. You can select one variant predefined or set up new one:

 

Daily - file will be created with name containing prefix, and date in format DDMMYYYY, where DD is two-digit day sign, MM is two-digit month sign and YYYY is four digits of the current year. The file name extension will be added at the end of file;
Monthly - file will be created with name containing prefix, and date in MMYYYY  format. The file name extension will be added at the end of file;
Each data packet in different file - in this mode the program splits data flow to a different file. In this mode you should configure the parser or the program will split a data by timeout about 300 ms.
Don't create new file - in this mode the program will write all data to one file. It is recommended for a small data flow. Otherwise your log file will be too big and a performance of the program will fall down;
User's format -  file will be created with name containing prefix and date in showed by you format (for example, DDMMYYYY). The file name extension will be added at the end of file. The file may not contain format signs, then file name will be constant. You should not use characters, that the OS doesn't allows in file name, such as "/,\.*,?" and some others.

 

Date and time formatting codes:

 

d        - day, not adding null(1-31).

dd        - day ,adding null(01-31).

ddd        - day of the week in text form(Mon-Sat) according to standard, set on this computer.

dddd - day of the week in full text form(Monday-Saturday) according to standard, set on this computer.

m        - month, not adding null(1-12).

mm        - month, adding null (01-12).

mmm  - month in text form(Jan-Dec) according to standard, set on this computer.

mmmm - month in full text form (January- December) according to standard, set on this computer.

yy        - year in the form of two last digits(00-99)

yyyy        - year in the form of four last digits (0000-9999).

h        - hours, not adding null (0-23).

hh        - hours, adding null (00-23).

n        - minutes, not adding null (0-59)

nn        - minutes, adding null (00-59).

s        - seconds, not adding null (0-59).

ss        - seconds, adding null (00-59).

 

Example: you want to create log file every hour. It is desired that file name starts from "sample_log" and the file extension "txt".

 

Answer: set file prefix = sample_log_, file extension= txt (without dot!). In file name format show HHDDMMYYYY. Now file will be created every hour. Naturally, you can set any formatting characters combination, described higher.

 

If you want to access to a log file while the program work, then you should configure access mode settings for the log file in the next chapter.



Ask a question about this topic


If you found an inconsistency in the above topic or you want to ask for support,
Please specify your question here:
Your e-mail address here:
and your name here:
Please ask only Advanced PBX Data Logger related questions.

Copyright © 1999-2008, AGG Software.
All rights reserved.