Limit log files size

  • | 1770 points

    Disk space is not problem, but opening all log files with code/text editors. Almost impossible when log files are several hundreds MB.

    I understand need for live servers, online servers and keep so huge log files. In case of for instance hacking you could check logs from months ago. And some other cases.
    But when Laragon is used on localhost so huge log files are absolutely not needed. Do you have a problem with some website ? Just refresh this website, front-end or back-end. Open log files and read what problem is. Theoretically it is enough with log files of 1-5 MB in size. When developing websites you are only interested in latest log lines.

    How to delete log files when they grow to one size, and continue making new one, and on and on ?

    I tried "rotatelogs". Works somehow, but activate several new windows processes. And cannot delete old log files. So if you forget (and you will) you have this installed and set, subfolder with logs will have a chaos of new log files.

  • | 1770 points

    I limited and resized them drastically with simple steps.

    ignore_repeated_errors = On
    ignore_repeated_source = On

    LogLevel warn to LogLevel error
    #CustomLog "logs/access.log" common
    Disabled access.log (really not needed when developing on localhost)

    Have to be aware of time stamps in php_errors.log. Will now not match allways to what I am doing on website(s).

  • administrators
    | 132054 points

    @Stagger-Lee : I understand your case. In case you have a very big log file, you can open it easily using TailBlazer (Menu > Laragon > Tools > TailBlazer)

  • | 1770 points

    Thank you. Fastest I have seen. Not so intuitive, but enough for log files.
    How to mark Topic solved ?

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.