Thread overview
Log rotation in std.logger.filelogger
May 17, 2023
Vitalii
May 22, 2023
Kagamin
May 23, 2023
apz28
May 23, 2023
Andrew
May 23, 2023
apz28
May 24, 2023
Vitalii
May 17, 2023

Hello!

Please tell me how to enable log rotation in std.logger.filelogger? Without log rotation, it seems that the std.logger.filelogger is useless, because it will quickly take up all the free space on the hard drive.

In theory, you can close the file in the logger, rename it, etc., open a new one, but the manual says that this will lead to undefined behavior. So how do you rotate the log?

Best regards,
Vitalii

May 22, 2023

I suppose you write a custom logger for that or take an already written one from code.dlang.org

May 23, 2023

On Wednesday, 17 May 2023 at 21:11:41 UTC, Vitalii wrote:

>

Hello!

Please tell me how to enable log rotation in std.logger.filelogger? Without log rotation, it seems that the std.logger.filelogger is useless, because it will quickly take up all the free space on the hard drive.

Or can try my log package
https://github.com/apz28/dlang/tree/main
https://github.com/apz28/dlang/tree/main/source/pham/external/std/log

log_logger.d
RollingFileLogger

Happy coding!

May 23, 2023

On Tuesday, 23 May 2023 at 11:21:07 UTC, apz28 wrote:

>

On Wednesday, 17 May 2023 at 21:11:41 UTC, Vitalii wrote:

>

Hello!

Please tell me how to enable log rotation in std.logger.filelogger? Without log rotation, it seems that the std.logger.filelogger is useless, because it will quickly take up all the free space on the hard drive.

Or can try my log package
https://github.com/apz28/dlang/tree/main
https://github.com/apz28/dlang/tree/main/source/pham/external/std/log

log_logger.d
RollingFileLogger

Happy coding!

Please don't take this as an insult, as I've also written my own logging library lol. But I have a feeling that our efforts would be better spent in improving the standard library's implementation rather than making our own logger. Hopefully this will become easier in the future as issues are migrated to github and more effort is put into organization.

May 23, 2023

On Tuesday, 23 May 2023 at 13:13:18 UTC, Andrew wrote:

>

On Tuesday, 23 May 2023 at 11:21:07 UTC, apz28 wrote:

>

On Wednesday, 17 May 2023 at 21:11:41 UTC, Vitalii wrote:

>

Hello!

Please tell me how to enable log rotation in std.logger.filelogger? Without log rotation, it seems that the std.logger.filelogger is useless, because it will quickly take up all the free space on the hard drive.

Or can try my log package
https://github.com/apz28/dlang/tree/main
https://github.com/apz28/dlang/tree/main/source/pham/external/std/log

log_logger.d
RollingFileLogger

Happy coding!

Please don't take this as an insult, as I've also written my own logging library lol. But I have a feeling that our efforts would be better spent in improving the standard library's implementation rather than making our own logger. Hopefully this will become easier in the future as issues are migrated to github and more effort is put into organization.

D is just a learning project (hobby one) and I do not have time to go through the process to add codes to standard library. However, it is www.boost.org/LICENSE_1_0.txt license so feel free to get it and add it to standard one

Cheers

May 24, 2023

On Tuesday, 23 May 2023 at 14:10:52 UTC, apz28 wrote:

>

On Tuesday, 23 May 2023 at 13:13:18 UTC, Andrew wrote:

>

On Tuesday, 23 May 2023 at 11:21:07 UTC, apz28 wrote:

>

[...]

Please don't take this as an insult, as I've also written my own logging library lol. But I have a feeling that our efforts would be better spent in improving the standard library's implementation rather than making our own logger. Hopefully this will become easier in the future as issues are migrated to github and more effort is put into organization.

D is just a learning project (hobby one) and I do not have time to go through the process to add codes to standard library. However, it is www.boost.org/LICENSE_1_0.txt license so feel free to get it and add it to standard one

Cheers

Thank you all very much! I'll try to do what you kindly suggested.

Vitalii