mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-17 08:45:55 +01:00
b22a41ca91
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
40 lines
740 B
ObjectPascal
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.
|