You can use a formatting file logger (atg.service.datacollection.FormattingFileLogger
) to write data from a data collection event to a flat file in a format you specify. A formatting logger lets you specify:
Which properties of your data item should be logged
The order the properties should be logged
Arbitrary constant strings to log
Format control strings (for date properties)
Field delimiters (written after each field except the last one)
Line terminator (written after the last field in the log entry)
FormattingFileLogger
components are also rotating loggers: you can set a schedule where the log file is closed and a new log is opened with a different name.
In production systems, you should use DataListenerQueues
to feed data to your formatting file logger. This allows unlogged data to queue up without being lost and without affecting the performance of data sources. See Data Collector Queues.