We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27330
    • 884 Posts
    Heya all,

    I recently noticed from my daily mysql backup script that my db is bigger than the allowed in the script settings.
    on Monday my .gz archive was 14MB and on Friday it reached 120MB

    I tried opening the sql files in ultra compare to see where is the difference but the files are too big sad

    so I went to the Report section of the manager and see the modx_event_log is 3.4GB

    my system events is full with phx info notices that I never knew about before and still tries to figure out wtf causes them.

    what’s the best way to remove all this junk?
    I want to drop the content on my modx_event_log table but not sure if it’s safe ?
    I’m sure that the errors will continue to fill up the log, and maybe when it’s empty I’ll be able to browse it faster.




      • 25663 MODX Staff
      • 12,272 Posts
      What plugins are you running in addition to PHx?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 27330
        • 884 Posts
        I have all these plugins enable
        # autolink 
        # Bottom Button Bar - Adds a set of buttons to the bottom of all manager pages
        # ContinueEditing - keeps the "Continue editing" checked
        # FileDownloadPlugin
        # Forgot Manager Login
        # GoogleAnalytics - Google Analytics 1.3
        # Inherit Parent Template 
        # manager login front
        # manager logout front end
        # PHx - PHx (Placeholders Xtended)
        # PNG-Alpha - PNG-Alpha for MSIE (PNGAlpha4MSIE)
        # QuickEdit - Front-end Content Editor.
        # Search Highlighting - Show search terms highlighted on page linked from search results. (Requires AjaxSearch snippet)
        # TemplateSwitcher - Changes templates used on all pages in your site.
        # TinyMCE - 2.1.3: TinyMCE RichText Editor Plugin
        # WebSnprX -
        


        right after posting yesterday I deleted the log via the Manager and disabled PHx to see if thats the only reason. This morning I looked again and the system events log is empty.

        what I noticed was that the system events yesterday were all information and not errors, after checking PHx parameters I see now this:

        &phxdebug=Log events;int;1 &phxmaxpass=Max. Passes;int;50


        so that might be the answer, still not sure what the &phxmaxpass=50 stands for?

        here is an extract of one of the information messages from PHx, I couldn’t see any problem with it, but not sure if I understand it correctly.

        if this is not an error and just an activity log maybe I should disable PHx loggin or change it to errors only.
        will appreciate your reply if there is something wrong here.

        Pass 1
        
        1 [15:22:11] MODx Chunks -> Merging all chunk tags
        2 [15:22:11] MODx Snippet -> AjaxSearch? &AS_showForm=`1`  &AS_landing=`70` &AS_showResults=`0`&ajaxSearch=`0` &grabMax=`10`&showMoreResults=`1` &moreResultsPage=`71`&addJscript=`1`
        3 [15:22:11]   |--- Returns: 
        <form action="[~70~]" method="post"> <label for="ajaxSearch_input"> <input id="ajaxSearch_input" type="text" name="search" value="Search here..." onfocus="this.value=(this.value=='Search here...')? '' : this.value ;" /> </label> <label for="ajaxSearch_submit"> <input id="ajaxSearch_submit" type="submit" name="sub" value="[+as.submitText+]" /> </label> </form>
        
        4 [15:22:11] MODx Snippet -> Ditto? &id=`random-camera` &display=`all`&randomize=`1`&parents=`17,37,36,89,131` &depth=`2` &total=`1` &tpl=`ditto-random-camera-tpl`
        5 [15:22:11]   |--- Returns: 
        <p> </p> <div style="width:200px;margin-left:8px;"> <b class="random-camera"> <b class="random-camera1"><b></b></b> <b class="random-camera2"><b></b></b> <b class="random-camera3"></b> <b class="random-camera4"></b> <b class="random-camera5"></b></b> <div class="random-camerafg"> <!-- content goes here --> <div class="ditto_item" id="ditto_item_280" align="center"> <a href="[~280~]"><img src="/assets/templates/blackgold/images/featured-camera.png" alt="" border="0" width="195" height="42" /></a> <div class="ditto_cameraImage"> <!-- <a href="[~280~]" > <img src="/assets/images/cameras/samsung/Samsung-SCC-C4301-small.jpg" alt="Samsung SCC-C4301-image" width="120" height="120" border="0" style="background: url(assets/templates/blackgold/images/random-camera-bckg.png) no-repeat 50%; padding: 20px 20px 20px 15px;"/></a> --> <a href="[~280~]" > <img src="/assets/images/cameras/samsung/Samsung-SCC-C4301-small.jpg" alt="Samsung SCC-C4301-image" width="120" height="120" border="0" style="background: transparent url(assets/templates/blackgold/images/random-camera-bckg.png) no-repeat 50%; padding: 20px 15px 20px 15px;"/></a> </div> <br /> <div class="ditto_features"> <a href="[~280~]" style="text-decoration:none;color:#FFFFFF;font-weight:bold; ">1/4?? Low Light, Color, Motorized Zoom Lens Camera</a> </div> </div> <!-- content ends here --> <a href="[~280~]" style="text-decoration:none;color:#FFFFFF;font-weight:bold; ">Read More...</a> </div> <b class="random-camera"> <b class="random-camera5"></b> <b class="random-camera4"></b> <b class="random-camera3"></b> <b class="random-camera2"><b></b></b> <b class="random-camera1"><b></b></b></b> </div>
        
        6 [15:22:11] MODx Snippet -> Ditto? &id=`random-testimonials` &display=`all`&randomize=`1`&parents=`158` &depth=`2` &total=`1` &tpl=`random-customer-review-tpl`
        7 [15:22:11]   |--- Returns: 
        <div style="margin-left:5px; padding:5px;"><p> I should have done it a long time ago, the new security cameras gives me so much freedom. I could leave the store whenever I need to, without worrying too much.</p></div><br /> <div align="right" style="padding:10px;"><p> -Aaron Norman, <br />Sport Goods Imports Inc.</p></div>
        
        8 [15:22:11] MODx / PHx placeholder variable: as.submitText
        9 [15:22:11]   |--- Skipping - hasn't been set yet.
        Pass 2
        
        10 [15:22:11] MODx Chunks -> Merging all chunk tags
        11 [15:22:11] MODx / PHx placeholder variable: as.submitText
        12 [15:22:11]   |--- Skipping - hasn't been set yet.
        13 [15:22:11] Cleaning unsolved tags: 
        as.submitText
        Pass 3
        
        14 [15:22:11] MODx Chunks -> Merging all chunk tags

          • 27330
          • 884 Posts
          * Log Events

          0 = Disabled
          1 = Enabled logging of PHx
          When enabled PHx creates a detailed processing log for every page load in the MODx System Event log ( Manager->Reports->System Events)

          * Max. Passes

          Enter a number which represents the maximum depth of your nested tags. I recommend leaving this on the default value of 50.

          I didn’t even dream PHx will create detailed log for every page load. was sure it’s just for PHx activities.
            • 25663 MODX Staff
            • 12,272 Posts
            You’ll likely run into trouble with TemplateSwitcher too... it’s advisable to delete it if at all possible.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 6726
              • 7,075 Posts
              Logging PHx events is only useful when you’re developping and not in production otherwise it’s only common sense to turn it off if you use it as much as I do it will mean quite a bit of logging... I should definitely check which other plugin have heavy logs but I sure never reached 3.4 Gb !!!
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 27330
                • 884 Posts
                I deleted TemplateSwitcher, never used it anyway.
                also removed loggin from PHx. I guess from the wiki there is no log event = errors only isn’t it?
                  • 27330
                  • 884 Posts
                  surprise surprise, after stopping PHx event logging my latest mysql *.gz backup file is 1.8MB smiley
                  and I was thinking my site has lots of content in it smiley
                    • 27330
                    • 884 Posts
                    ganeshXL do u mind sharing how do u do it with cron jobs?
                    As u said, the manager log is useless sometimes, but I would also like to drop the system even log every now and then.

                    I see in almost all my modx site this clean up is required after few months, would be nice letting cron do it for me.
                      • 4310
                      • 2,310 Posts
                      Nice one ganeshXL, I love the poor man’s crontab idea.
                      Oh, and it works a treat grin