danieleteti / loggerpro

An modern and pluggable logging framework for Delphi
Apache License 2.0
353 stars 91 forks source link

Add a custom logs folder in the TLoggerProFileAppender #2

Closed danieleteti closed 8 years ago

danieleteti commented 8 years ago

Add a custom logs folder in the TLoggerProFileAppender options in the constructor

    constructor Create(
      aMaxBackupFileCount: Integer = DEFAULT_MAX_BACKUP_FILE_COUNT;
      aMaxFileSizeInKiloByte: Integer = DEFAULT_MAX_FILE_SIZE_KB;
      aLogsFolder: String = ''; //by default, it logs into the executable folder
      aFileAppenderOptions: TFileAppenderOptions = [];
      aLogFormat: String = DEFAULT_LOG_FORMAT);
danieleteti commented 8 years ago

file_appender.proj sample show how to use this feature

// Creates log in the ..\..\ folder without PID in the filename
_Log := BuildLogWriter([TLoggerProFileAppender.Create(10, 5, '..\..')]);
// if you want to create logs in the exe' same folder
// _Log := BuildLogWriter([TLoggerProFileAppender.Create(10, 5)]);