The logfile is growing and growing.
And I don't find a way to delete older entries. Is there a way to do this manually?
And how do I do it via cron?

There is only an option to delete older usage statistics, but not normal log entries.

Help appreciated.

Comments

VM’s picture

Login toy our Database, select the watchdog table and empty it.

_____________________________________________________________________________________________
give a person a fish and you feed them for a day but ... teach a person to fish and feed them for a lifetime

eigentor’s picture

O.K. No other way?

I'm happy being miserable

VM’s picture

you can set in administer -> access log settings Discard access logs older than: to 1 hour and run cron manually if you so choose. but the ony way to empty the table completly is by emptying the table using phpmyadmin or a likewise tool for datasbases.

_____________________________________________________________________________________________
give a person a fish and you feed them for a day but ... teach a person to fish and feed them for a lifetime

beert’s picture

<form name="form0" method="post" action="">
  <input name="wdog" type="hidden" value="1">
  <input type="submit" name="Submit" value="Clear WATCHDOG">
</form>
<?php 
  if( isset($_POST[wdog]) )
   {
   db_query("TRUNCATE TABLE {watchdog}");
   echo "The table 'watchdog' has been cleared."; 
   }
?>

Please note this completely empties the watchdog table.
Use at our own risk.

eigentor’s picture

I'm looking for furher ways to reduce the size of my database.
looking into it, I'm finding that the tables locales_source, locales_target
and the cache tables consume the biggest part of space.

Is there a way to change that or can the caching tables just be emptied just as well?

By the way - thanks to beert for the code. Works like a charm.

I'm happy being miserable

VM’s picture

cache tables can be emptied as well, however they will regenerate as anon users are served cached pages regardless of cache settings.

It may be of benefit for you to install the devel.module which will provide for you buttons to clear certain tables when you so choose.

your locale tables however, are holding the information that can't be emptied as these tables hold within them the information for your multilanguage set up. Even if not using a foreign language & only using a site specific language where you have changed Drupal terminology to your own.

_____________________________________________________________________________________________
give a person a fish and you feed them for a day but ... teach a person to fish and feed them for a lifetime

eigentor’s picture

This helped. Just found out that the size of the database of an older installation was consumed at 85% by the watchdog table (!).
In exporting, one can leave out the cache tables, and things should be fine. There is still a lot to learn, but this really cheered me up. Making sure the database only contains what is needed makes sense.

I'm happy being miserable