A log target that prints messages to files. Can only be used on target where the sys package is available
Constructor
new(directory:String, filename:String = "current.txt", numLogFiles:Int = 9, logLevel:LogLevel = LogLevel.Info, printTime:Bool = false, machineReadable:Bool = false, clearLogFile:Bool = true, useThread:Bool = false)
Creates a log target that prints messages to files in a specified directory
Parameters:
directory | The root directory of the log files |
---|---|
filename | The name of the currently used log file. The rest of the files will be generated and named automatically |
numLogFiles | The number of log files to keep. If 0, only the log file with the name filename will be kept, the rest of log files will be purged from the directory |
logLevel | Default log level. Any messages with higher level than this will not be logged |
printTime | Prints a time-stamp for every message logged, if true |
machineReadable | Prints messages in machine-readable format (Json string) |
clearLogFile | Clears and resets log file, if true. If false, logs will be appended to the existing log file |
useThread | If true, log messages will be processed printed in a newly created thread. Note: all instances of FileTarget will use the same thread |