#1 2024-01-11 07:48:45

sgavrilov
Member
Registered: 2019-05-24
Posts: 20

RotateFileNoCompression

Happy New Year to everybody!

The TSynLog.Family has the RotateFileNoCompression property in the mORMot1 but I have not found any analogue in the mORMot2.

Is there a way to rotate old logs without compression in mORMot2?

Sergey

Offline

#2 2024-01-11 08:05:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: RotateFileNoCompression

You need to use the LogCompressAlgo global variable.
If you set it to nil, no compression will take place.

I have refined the documentation about LogCompressAlgo
https://github.com/synopse/mORMot2/commit/334a8ad4

Online

#3 2024-01-11 09:17:33

sgavrilov
Member
Registered: 2019-05-24
Posts: 20

Re: RotateFileNoCompression

Thank you!

Offline

#4 2024-01-25 07:40:54

sgavrilov
Member
Registered: 2019-05-24
Posts: 20

Re: RotateFileNoCompression

Unfortunately, this does not work:  empty {LogName}.#.synlz files are created.

It looks like I have to either write a custom OnRotate handler, or write a "dummy" TAlgoCompress inherited class and assign its name to LogCompressAlgo.

Offline

#5 2024-01-25 07:58:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: RotateFileNoCompression

Are you sure you have the latest version of the source?

TSynLog.PerformRotation clearly checks LogCompressAlgo, and if nil, won't use AlgoFileExt and call RenameFile() without any compression, using a {logName}.#.log rotation file.

Online

#6 2024-01-25 12:41:49

sgavrilov
Member
Registered: 2019-05-24
Posts: 20

Re: RotateFileNoCompression

My fault! I had not pulled the latest version.

Offline

Board footer

Powered by FluxBB