1

I'm trying to discover how I can reduce the redundant logs (PHP errors, Drupal messages, debug logs, whatever) that are stored in Drupal's database and in Apache's log folders. I'm primarily a designer, certainly not a sysadmin, but I'd like to use whatever logging methods are most efficient, from a performance perspective as well as a disk space perspective.

I'm not sure if it is relevant to this issue, but I am using Drupal 6.

Is there anywhere I can find an ideal configuration for what to log on which of the two systems? If not, how can I find out exactly what is being logged in which locations, and how to turn off one or the other?

3

There's a good drupal.org page on how to switch from dblog to syslog module: see Syslog: using the operating system's logging facility.

"Because the Database logging module writes logs to the database it can slow down the website. By using Syslog you can improve the performance of the site."

Combine that with a log rotation strategy of some sort. And then you'll soon be knee-deep in sysadmin-esque territories. But probably not neck-deep though if you catch my drift. Lots of good documentation online for log rotation. Also, I've not done this on D6, only D7, but that page referenced above does have instructions for D6.

|improve this answer|||||
  • I'd like to investigate this one further, I think. I'm understanding, then, that no logs would be in Drupal; they'd all just be in Apache's log directory. I assume we'd have a smaller database then, and the directory size wouldn't get any bigger. A performance plus sounds nice too. When you say log rotation - do you mean clearing the directory at intervals? – Jonathan Stegall May 6 '15 at 17:37
  • Right, no logs being recorded to the database, no logs being periodically removed depending on the number of items you set as max. Instead, all messages are logged to a text file. The text file can live where you want it to on the server, like that d.o page suggests: "local0.* /var/log/drupal.log" - so Drupal would start logging it there, right with all your other logs. RE: log rotation, clearing the directories, sort of. Basically getting rid of log files periodically as they can take up a lot of space over time. – cdmo May 6 '15 at 17:53
  • You can setup sophisticated cron tasks to monitor logs and delete or move them as you see fit. Or you can manually take a look at the size of the log file(s) and manually delete/archive as you see fit... – cdmo May 6 '15 at 17:56
0

Apache logs would depends base on your OS that you are running your server. For instance, if you are running Ubuntu 14.04 and the latest stable version of Apache your logs would be located at /var/log/apache2. In that directory you mostly like are going to find Error logs and your Access Logs. Errors logs are mainly for "errors" and acess logs are for the users and robots that visit your website.

Drupal logs can be found from the Drupal UI at admin/reports/dblog.

If you are going to remove any logs from your server I would strongly suggest that you backup everything.

Personally, I do not think you should turn off your logs just because logs can be helpful in case of something goes wrong with your site.

|improve this answer|||||
  • 1
    Thanks. To be clear, I don't want to turn off any logs. I just am in a scenario when many of the logs are in Apache's log directory and in Drupal's database. This makes them take up more space than if they were only in one place. – Jonathan Stegall May 6 '15 at 16:10
  • Just make sure you have a backup just in case you need it later. – itsdarrylnorris May 6 '15 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.