How to switch to hourly logs..?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crmtesting
    Junior Member
    • Oct 2024
    • 24

    How to switch to hourly logs..?

    My Espocrm crashed a few days ago because there was no space left... it created 71 GB logs on 17th for some reason. I didn't get to know about it and the server crashed on 25th december. had a bad christmas.
    It was not possible to download 71GB and and I thought it might not happen again. I just tail on the logs and there were some warnings, so I ignored it and carried on with the holidays.
    This happened again today and new year mood was ruined. within a span of 4 hours there were 75GB of logs, no space left and the server crashed. Had to delete the log again to bring the site up. It would be better if I could have hourly logs.. that way I can atleast have some logs to inspect what's going wrong.

  • crmtesting
    Junior Member
    • Oct 2024
    • 24

    #2
    Please help with this.

    Comment

    • yuri
      Member
      • Mar 2014
      • 8518

      #3
      I should stop developing software to not to ruin people's Christmas and New years.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8518

        #4
        You can decrease the max file number: https://github.com/espocrm/espocrm/b...config.php#L84

        You can implement a custom log handler or use any existing Monolog handler.

        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • esforim
          Active Community Member
          • Jan 2020
          • 2206

          #5
          I guess one work around is to have some sort of 'Workflow Schedule' in your server/system where the file is copied to with a new filename, delete the current logs and EspoCRM will generate a log 'fresh' log file.

          Comment

          • crmtesting
            Junior Member
            • Oct 2024
            • 24

            #6
            Originally posted by esforim
            I guess one work around is to have some sort of 'Workflow Schedule' in your server/system where the file is copied to with a new filename, delete the current logs and EspoCRM will generate a log 'fresh' log file.
            yes, that could also be a good idea. implementing log rotation for the same.

            Comment

            • crmtesting
              Junior Member
              • Oct 2024
              • 24

              #7
              yuri esforim got this issue again, and this is the warning that is gnerating GB of logs.

              You MUST recompile PHP with a larger value of FD_SETSIZE. It is set to 1024, but you have descriptors numbered at least as high as 1031. --enable-fd-setsize=2048 is recommended, but you may want to set it to equal the maximum number of open files supported by your system, in order to avoid seeing this error again at a later date.

              Comment

              • yuri
                Member
                • Mar 2014
                • 8518

                #8
                I recommend fixing the issue so that the error does not occur anymore. It's not an issue with Espo, something with your environment, with PHP. My Friday mood is ruined.




                If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                Comment

                • yuri
                  Member
                  • Mar 2014
                  • 8518

                  #9
                  I can also increase the log level to ERROR.

                  Checking file size for rotation has its drawbacks. Hourly rotation won't solve the problem entirely. The files still can be big.

                  You can also utilize the Logrotate tool.
                  Last edited by yuri; Today, 05:49 PM.
                  If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                  Comment

                  • crmtesting
                    Junior Member
                    • Oct 2024
                    • 24

                    #10
                    Originally posted by yuri
                    I recommend fixing the issue so that the error does not occur anymore. It's not an issue with Espo, something with your environment, with PHP. My Friday mood is ruined.



                    I am very sorry about it. Apologies. I am using 4GB digital ocean droplet. there's not much user activity.
                    Last edited by crmtesting; Today, 08:32 PM.

                    Comment

                    Working...