delphimvcframework/samples/09_jsonl_appender/LoggerProConfig.pas
Daniele Teti b22a41ca91 Squashed 'lib/loggerpro/' changes from 7f850ebc..0b6857bd
0b6857bd Updated unit tests and automatic tasks
35d130d6 VERSION_1_4_4
2e4a80f4 Removed PasDoc documentation; Added unit tests for LogLayoutToLogFormat
8f61bc22 Removed TLogAppenderOptions, DEFAULT_LOG_FILENAME_FORMAT is now TLogLayout.* (there many possibilities); FileName layout use placeholders instead of indices (as format function does).
be43f781 Merge branch 'master' into v2.0

git-subtree-dir: lib/loggerpro
git-subtree-split: 0b6857bd8d51f5acb246561564b3c3bbd963d192
2024-01-02 16:30:52 +01:00

40 lines
740 B
ObjectPascal

unit LoggerProConfig;
interface
uses
LoggerPro,
LoggerPro.Proxy;
function Log: ILogWriter;
implementation
uses
LoggerPro.FileAppender, LoggerPro.JSONLFileAppender, System.SysUtils;
var
_Log: ILogWriter;
function Log: ILogWriter;
begin
Result := _Log;
end;
initialization
// The TLoggerProFileAppender has its defaults defined as follows:
// TLoggerProJSONLFileAppender = '{module}.{number}.{tag}.log';
// DEFAULT_MAX_BACKUP_FILE_COUNT = 5;
// DEFAULT_MAX_FILE_SIZE_KB = 1000;
// Creates logs in the ..\logs folder without PID in the filename
_Log := BuildLogWriter([
TLoggerProJSONLFileAppender.Create(10, 5, '..\logs',
TLoggerProJSONLFileAppender.DEFAULT_FILENAME_FORMAT,
TEncoding.UTF8
)
]);
end.