katzgrau / KLogger

A Simple Logging Class For PHP
http://codefury.net/projects/klogger/
981 stars 284 forks source link

Possible to have log rotation? #86

Closed UweKeim closed 6 years ago

UweKeim commented 6 years ago

Is it possible to automatically configure KLogger to rotate log files?

E.g.

onno-vos-dev commented 6 years ago

You could easily setup log rotation on a system level. Probably the cleanest way to do it either way.

At the moment it is not supported though as this logger is intended as an extremely lightweight logger when you compare it to other loggers that are out there. Not sure what @katzgrau thinks about introducing such functionality?

UweKeim commented 6 years ago

Thanks., I need to do it from PHP only. Probably will add some custom routine in my code to do so.

onno-vos-dev commented 6 years ago

May I ask why? I'm assuming you'll have the possibility of setting logrotate on the machine/vm you'll be running your stuff from?

UweKeim commented 6 years ago

Sure. We do use KLogger inside or (German only) CMS where users simply deploy their website via a simple button click to their system (FTPS/SFTP).

Zero configuration on the underling system should be required.

onno-vos-dev commented 6 years ago

It should be quite easy to follow up an instance of Klogger with something like: rotate (I'm not working with PHP anymore so I can't give you my experience but it seems to suit your needs.

UweKeim commented 6 years ago

That looks awesome, thanks a lot!