Huge debug.log because of “undefined offset in media.php”

I know it was mentioned in the comments that you solved this by locating the offending plugin. However, I thought the following answer may be helpful for others if they happen along this in a search.

Here’s a little code snippet that can be used to save the debug log file by date:

ini_set( 'error_log', WP_CONTENT_DIR . '/debug-' . date('Y-m-d') . '.log' );

Using this method, you can prevent the file from just growing (it will set a new one each day).

Obviously, you want to track down the real problem so the debug log doesn’t grow infinitely. But using something like this can buy some time to help during the process.