Error Handling & Logging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Snowhog
    New Member
    • Nov 2012
    • 16
    • 4.2.X

    [Forum] Error Handling & Logging

    I need some help setting up Error Handling & Logging correctly.

    We have a logs directory 'one level above' our forum root directory:

    drwxr-xr-x 2 root root 4096 2012-11-19 13:39 logs

    An error.log and access.log file was being written to, but were getting large. The access.log was over 2 GB, and the error.log was over 49 MB.

    I gzipped both (with the forum taken off-line), and now, neither have been recreated. Therefore, I created both using touch, but they are not being written to.

    Additionally, we didn't have the log file paths set in Error Handling & Logging, so I set them as follows:

    /srv/www/kubuntuforums.net/logs/dberrors.log
    /srv/www/kubuntuforums.net/logs/admincperrors.log
    /srv/www/kubuntuforums.net/logs/phperrors.log

    I created the three files with touch.

    These files are also not being written to.

    What am I doing wrong?
  • In Omnibus
    Senior Member
    • Apr 2010
    • 2310

    #2
    It might be a good idea to rename your new files with the same names as the files you are replacing, error.log and access.log

    Comment

    • Snowhog
      New Member
      • Nov 2012
      • 16
      • 4.2.X

      #3
      I have those two log files as well.
      I gzipped both (with the forum taken off-line), and now, neither have been recreated. Therefore, I created both using touch, but they are not being written to.
      The logs directory contains:
      Code:
      -rw-r--r-- 1 root root         0 2012-11-19 13:39 access.log
      -rw-r--r-- 1 root root 170222319 2012-11-19 13:15 access.log.gz
      -rw-r--r-- 1 root root         0 2012-11-19 13:39 admincperrors.log
      -rw-r--r-- 1 root root         0 2012-11-19 13:39 dberrors.log
      -rw-r--r-- 1 root root         0 2012-11-19 13:39 error.log
      -rw-r--r-- 1 root root   2624435 2012-11-19 13:16 error.log.gz
      -rw-r--r-- 1 root root         0 2012-11-19 13:39 phperrors.log

      Comment

      • snakes1100
        Senior Member
        • Aug 2001
        • 1249

        #4
        Is there some reason that your logging?

        Unless your having issues, there is no reason to log any of those, unless you want to track attacks on your admincp, it would be better to htaccess protect it & rename it, set the config.php admincp rename option to the new name.

        No need to waste resources on logging.
        Gentoo Geek

        Comment

        • Snowhog
          New Member
          • Nov 2012
          • 16
          • 4.2.X

          #5
          Understood, but I'd still like to know why the logging isn't taking place. I'd like to get it working and then not use it, than want to use it and not have it working.

          Comment

          • snakes1100
            Senior Member
            • Aug 2001
            • 1249

            #6
            Whats the perms on the folder & files?
            Gentoo Geek

            Comment

            • Snowhog
              New Member
              • Nov 2012
              • 16
              • 4.2.X

              #7
              Originally posted by snakes1100
              Whats the perms on the folder & files?
              Already provide in the prior posts.
              Originally posted by Snowhog
              We have a logs directory 'one level above' our forum root directory:

              drwxr-xr-x 2 root root 4096 2012-11-19 13:39 logs

              The logs directory contains:
              Code:
              -rw-r--r-- 1 root root         0 2012-11-19 13:39 access.log
              -rw-r--r-- 1 root root 170222319 2012-11-19 13:15 access.log.gz
              -rw-r--r-- 1 root root         0 2012-11-19 13:39 admincperrors.log
              -rw-r--r-- 1 root root         0 2012-11-19 13:39 dberrors.log
              -rw-r--r-- 1 root root         0 2012-11-19 13:39 error.log
              -rw-r--r-- 1 root root   2624435 2012-11-19 13:16 error.log.gz
              -rw-r--r-- 1 root root         0 2012-11-19 13:39 phperrors.log

              Comment

              • snakes1100
                Senior Member
                • Aug 2001
                • 1249

                #8
                777 perms on the folder, remove the log files & test to see if it creates & writes to them.
                Gentoo Geek

                Comment

                • Snowhog
                  New Member
                  • Nov 2012
                  • 16
                  • 4.2.X

                  #9
                  Got it working.

                  I created a directory (errorlogs) within our forums root directory and chmod it to 0777. Don't want a 0777 folder outside our forum root. Then set the paths/file_name as follows:

                  /srv/www/kubuntuforums.net/errorlogs/db
                  /srv/www/kubuntuforums.net/errorlogs/admincp
                  /srv/www/kubuntuforums.net/errorlogs/php

                  Tested by accessing the AdminCP log in page and deliberating using an invalid username and password. The admincp.log file was created. I'm a happy camper.

                  Comment

                  • snakes1100
                    Senior Member
                    • Aug 2001
                    • 1249

                    #10
                    777 isnt a security issue, unless you let it be, by having a security hole in a script thats using it to improperly allow writing of files that have executable code in them.

                    lol you didnt secure the folder by having it in the forum root, if that parent folder is still in a public area of the site.
                    Gentoo Geek

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...