really big error_log

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kenny
    Confirmed User
    • Mar 2002
    • 7245

    #1

    really big error_log

    My /usr/local/apache/logs/error_log was almost 5 gigs in size, due to broken ssi commands after I changed servers causing the website not to respond, they had to pay some tech to figure it out. Pretty fucked up huh?
    7
  • mike503
    Confirmed User
    • May 2002
    • 2243

    #2
    apachectl stop

    rm error_log

    apachectl start


    problem solved. or mv it somewhere, if you want a backup that badly. be sure to gzip though.
    php/mysql guru. hosting, coding, all that jazz.

    Comment

    • kenny
      Confirmed User
      • Mar 2002
      • 7245

      #3
      I had no idea a big error log would cause httpd to stop working,
      we kept seeing "httpd dead but subsys is locked" on the "httpd status" command thought something was really fucked up for awhile. I learned today that there is a million unix commands I don't understand
      7

      Comment

      • mike503
        Confirmed User
        • May 2002
        • 2243

        #4
        the bigger the files get the more resources (in theory) they'll eat. although i don't know the technical specifics of file I/O and shit in linux and other unices, it does keep the file open but may be able to flush the memory each write.. problem is opening the file to append it may need to open the huge file. but again, i'm not on that level of technical knowledge.
        php/mysql guru. hosting, coding, all that jazz.

        Comment

        • kenny
          Confirmed User
          • Mar 2002
          • 7245

          #5
          Don't I feel stupid. spent 8 hours reading old apache yahoo forums and surfing google for answers, and the whole time the answer was in my sig
          7

          Comment

          • RK
            Confirmed User
            • Aug 2001
            • 868

            #6
            Originally posted by kenny
            My /usr/local/apache/logs/error_log was almost 5 gigs in size, due to broken ssi commands after I changed servers causing the website not to respond

            I see this fairly often on servers that are not managed properly. Apache usually stops working at 2 GB, I believe that has something to do with maximum file size limit, not any problem with too much resources being used. 5 GB is much less common, what version of Apache and OS are you using?

            I just usually send the main error log to /dev/null and the virtual host error logs to users directory after a server is running.
            Does anyone look down here?

            Comment

            • toddler
              Confirmed User
              • Jun 2002
              • 1911

              #7
              kenny, find a new admin, one who knows
              how write a 3 line log rotate script.

              i ran into this type of thing A LOT when
              i was running efront's servers. and their
              webmasters would insist it be fixed
              without shutting down httpd.

              one thing you can do to blow out
              the logs, is

              cp /dev/null /path/to/logfile

              will zero out the file.

              note, depending on the os, if you do this
              while the server is running, you may have some issues, depending on whether the app has an open file handle to the log. in which case you'll see it as 0 bytes in a long list (ls -l), but you won't have the space back in
              a df output. if that happens, send apache
              a HUP. (apachectl restart should work fine)

              again, get a new admin, the one you have doesn't seem to be able find his/her ass with both hands and a mirror.

              t
              http://www.flickr.com/photos/zoddler/

              Comment

              • mike503
                Confirmed User
                • May 2002
                • 2243

                #8
                there's a "rotatelogs" script that comes with apache.. put that down too, it'll help. (you could even rig it to gzip old logfiles too..if it doesn't already.)
                php/mysql guru. hosting, coding, all that jazz.

                Comment

                • Dreamman010
                  Confirmed User
                  • Jan 2002
                  • 1081

                  #9
                  Currently, my apache logfile size is

                  11326424423

                  Which is 11.3Gb. I am having no problems though but i'm going to delete it.
                  <a href="http://www2.famoushost.com/home.php" target="_blank"><b><FONT COLOR="FFFF00">www.FamousHost.com</font></b></a><br>Free Hosting With No Headers, Real FTP, <u>Get listed on the biggest TGP's with us!</u>

                  Comment

                  • darksoul
                    Confirmed User
                    • Apr 2002
                    • 4997

                    #10
                    Apache doesn't care about huge files.
                    to quickly remove a big file do
                    promt# cat /dev/null > /path/to/file
                    this way you won't need to restart apache.
                    and if you don't need error logs link the file to /dev/null
                    ln -s /dev/null /path/to/error_log
                    1337 5y54|)m1n: 157717888
                    BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                    Cambooth

                    Comment

                    Working...