#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    MySQL Database Logging


    Hi,

    I understand that we can set the path in my.ini to enable the General Log for MySQL database which will log every event (data access from SQLyog or from application) into the file.

    The problem is this log file will keep growing very fast to reach GB file size if my application is running within an hour.

    I wish to know is there other way that i can split the file lets say based on file size or date???

    Or is there any other setting to configure or limit the logging event or pattern so that it won't just log everything that have changed on database???


    Thanks in advanced for any help or suggestion.
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Or is there any other setting to configure or limit the logging event or pattern so that it won't just log everything that have changed on database???
    You can limit the logging to only log queries that take longer than a particular number of seconds to execute. If the purpose of logging every query is to analyze performance, then using this option makes sense because it allows you to ignore fast queries.

    Splitting logs is often done by an external program like logrotate. I know logrotate can be configured to rotate the log files on a daily basis; I'm not sure, but it might be possible to configure it to rotate the log files on an hourly basis too.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo