The following properties of the FormattingFileLogger component enable you to control how you name the log files:

Property

Type

Function

logFileDir

string

Specifies the directory where log files are written, relative to <ATG9dir>/home/

Example:

logs

logFileName

string

Specifies the first element of the log’s file name.

Example:

logFileName=userevents_

logFileExtension

string

Specifies the file extension (such as data, log) that is attached to each log file.

Example:

logFileExtension=data

timestampLogFileName

Boolean

If set to true, a timestamp is included in each log file name.

timestampDateFormat

string

Specifies the date format to use in file name timestamps.

Example:

MMddyyyy_HHmmssSS

For example, the following property settings yields log file names like userevents_02092001_18360355.data:

logFileName=userevents_
logFileExtension=data
timestampLogFileName=true
timestampDateFormat=MM-dd-yyyy_HH-mm-ss-SS

Using timestamps in your log file names ensures that log files have unique names and are preserved on application restarts.

In the timestampDateFormat, avoid using separator characters that result in invalid file names in your operating system. For example, if you set:

timestampDateFormat=yyyy-MM-dd_HH:mm:ss

the resulting log file name is like this:

userevents_02-09-2001_18:36:03.data

Because the colon ( : ) is not a valid character in Windows file names, this yields errors on a Windows platform.

The schedule and scheduler properties of the FormattingFileLogger determine when a log file is closed and a new log created with a new name.

 
loading table of contents...