Logging
A standard logging method exists for Alfabet utilities. Logging information is written to a log file at runtime in the following format:
- <date and time> <message type> <message text>
For example:
- 2009-02-24T12:30:15.4397058Z INFO start external source synchronization
The timestamp is the UTC time (coordinated Universal Time) and may therefore differ from the time in your local time zone. The timestamp is written in ISO 8601 combined date and time format as year-month-dayThour:minutes:secondsZ.
The message type can be one of the following:
- ERROR: An error occurred. The message describes the type of error.
- WARNING: Problems were encountered during the execution of the utility that are not as severe as an error. The process was executed but the result should be checked. The message describes the problem.
- INFO: Information about the normal execution of the utility is given.
Command line options that can be used with every Alfabet utility using the standard logging allow you to specify the number and location of log files as well as the amount of detail of the logging information:
Command Line Option | Default | Description |
---|---|---|
-logpath <log file path> | Log file is stored in the working directory of the executable. | Specification of a path to a directory for storage of the log file. |
-logfile <log file name> | <Executable><timestamp>.log | Specification of the log file name. Allowed file extensions are LOG and TXT.
NOTE: Setting -logfile changes the way log information is stored. If -logfile is not defined, a new log file is created each time the utility is used and the log file name is extended with a timestamp specifying the current UTC time. The timestamp is the UTC time written as "_yyyymmdd_hhmmss". For example: logfilename_20090328_150827.log. If -logfile is defined, logging information is appended to the already existing log file each time the utility is used. To restrict the file size, you can set the -logclear option to delete old log messages. |
-nologappend | This option is only evaluated if -logfile is defined.
If -nologappend is set, the log file defined with -logfile and -logpath is overwritten with a new file containing the current log information each time the utility is used. If -nologappend is not set, logging information is appended to the already existing log file each time the utility is used. NOTE: To restrict the file size, you can set the -logclear option to delete old log messages. |
|
-logverbose | If -logverbose is set, additional information about the running process is logged. The content and amount of additional information messages depend on the utility used. If setting -logverbose does not change the log output, there are no additional information messages available for the utility.
NOTE: Verbose logging is in most cases not required and can lead to a decrease in performance. |
|
-logclear <number of days> | Infinite | This option can only be used if -logfile is defined and -nologappend is not set.
During logging, the log file is scanned for log messages with a timestamp older than the number of days specified with -logclear and these messages are deleted. NOTE: The scanning process can lead to drawbacks in performance. |