3 Replies Latest reply on Jan 8, 2015 10:35 AM by travispressestheredbutton

    FM server log files get big



      FM server log files get big

      Your post

      I've been running FileMaker Server 12 advanced and the log files keep growing. Do you have advice on how to archive them and trim to keep just the recent log records? The wpc_access_log.txt file is at 820MB with 2 years worth of logs. I'd like to archive the records for 2013 and 2014 and only keep records for 2015 in the file. I wrote some scripts to do that but I had trouble overwriting the log file with just 2015's records. Apparently FileMaker Server has the file opened and won't let me overwrite. I'm running as administrator so I don't think permissions are the problem.

      Any related advice would be appreciated.

        • 1. Re: FM server log files get big

          Im a fan of logrotate http://www.thegeekstuff.com/2010/07/logrotate-examples/


          looks like they have one for windows as well. http://sourceforge.net/projects/logrotatewin/


          I don't know if you have this in 12 but in 13 we can cap the size in the admin console - http://www.filemaker.com/help/13/fms/en/index.html#page/fms/config_dbserver_logging.html

          • 2. Re: FM server log files get big

            Thanks for the pointer to the windows version of logrotate. I use it on linux a lot. Would you mind sending me a snippet of the configuration file you use for FileMaker? I don't know if I need to stop/start the FM server in prerotate/postrotate steps. or exactly how to do that.

            Actually the size of the log files isn't the real problem. What I'm doing is archiving 2 of the log files to another host, and trimming the log file to contain only those new records that haven't been archived yet.

            FM server 12 does have admin console settings for logs. We have them set to 100MB for the Database Server and 40MB for Web Publishing. The setting for Web Publishing apparently has no effect. In the past 24 months the pe_application_log.txt file has grown to 203.7MB and wpc_access_log.txt has grown to 820.6MB. The Database Server setting does work for Stat.log since its size is 104,857,725 bytes.

            • 3. Re: FM server log files get big

              Here is a sample for FileMaker:

              1 /Library/FileMaker\ Server/Logs/stderr {
                2   size 500M
                3   rotate 7
                4   compress
                5 }
                67 /Library/FileMaker\ Server/Logs/Event.log {
                8   size 500M
                9   rotate 7
               10   compress
               11 }

              When Event.log/stderr get to 500M logrotate will move Event.log to Event.log.1. When Event log grows to 500M again it will do the same rotation except Event.log.1 will be compressed to Event.log.2.gz.

              When Event is rotated to Event.log.1 there will be no Event.log. In my experience it's not a problem. FileMaker Server will create it when it has something to log. If you do want a new Event.log to be created you can use the create command:

              1 /Library/FileMaker\ Server/Logs/Event.log {
                2   size 500M
                3   rotate 7
                4   create 644 fmserver fmsadmin
               5   compress
               6 }


              You would need to run this with the correct privileges to assign the file to the fmserver group. 

              You can test your config file with

              logrotate -vf /path/to/config_file