-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log Rotate does nort work properly: why? #87
Comments
Any Idea? |
Can you provide a reproducible test case as self-contained project?
Il lun 11 mar 2024, 18:04 nmm71 ***@***.***> ha scritto:
… Any Idea?
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAK4ZJBURWAJGECAPJ2MO6TYXXP2BAVCNFSM6AAAAABEBLYFQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBYHE3TCMBZGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
yes.. a minimal modified version of 02_file_appender from the samples... in LoggerProConfig.pas: if you use ...TLoggerProFileAppender.Create(90, 5, ... then you get only two files 01 an d02 , one 5k, one 3k when you klick "2000 Info": all Messages 1 to 1905 are lost. If you use TLoggerProFileAppender.Create(90, 10000, you get only on file with all 2000 messages. Regeards |
Without looking at the code: is it possible that the timestamp that you add to the file names is causing the confusion? |
There are some problems:
Version 2 solved all these potential problems with custom filename formats. Please, try to use the version 2 (compatibility with older delphi version has been repristinated). The only placeholders you can use in the file names are the following: {module}: replaced with the module name This is the initialization you should use in V2 _Log := BuildLogWriter([
TLoggerProFileAppender.Create(90, 10000,
'logs',
'{module}.{number}.{tag}.log'
)
]);
|
OK, Thank you for that information! |
Hi,
I used
_Log := BuildLogWriter([
TLoggerProFileAppender.Create(10, 1000,
'..\proglog',
[],
'%0:s %1:2.2d '+
System.StrUtils.ReplaceStr(GetLoggedOnUser+' ON '+
GetRealComputerName,'.','_')+' AT '+
System.SysUtils.FormatDateTime('yyyymmddhhnnsszzz',System.SysUtils.now),
DEFAULT_LOG_FORMAT)]);
and got (on a certain session) a 32 k file containig all my log-messages:
>dir
My-Prog 00 nmm ON My-Comnputer AT 20240301091109558 32.475 01.03.2024 09:12 -a--
but if I use
_Log := BuildLogWriter([
TLoggerProFileAppender.Create(90, 5,
'..\proglog',
[],
'%0:s %1:2.2d '+
System.StrUtils.ReplaceStr(GetLoggedOnUser+' ON '+
GetRealComputerName,'.','_')+' AT '+
System.SysUtils.FormatDateTime('yyyymmddhhnnsszzz',System.SysUtils.now),
DEFAULT_LOG_FORMAT)]);
I got only two files
>dir
My-Prog 00 nmm ON My-Comnputer AT 20240301091317671 1.727 01.03.2024 09:13 -a--
My-Prog 01 nmm ON My-Comnputer AT 20240301091317671 5.255 01.03.2024 09:13 -a--
and many log-messages are missed (I performed exactly the same session as above),
What have I done wrong?
(I used your stable version 1.4.0)
(I also tried Version 2.0 beta, but this won't compile in Delphi 10.3 (because of use of embesdded var-constructs))
Regards
nmm
The text was updated successfully, but these errors were encountered: