I have a file /var/logs/apache2/error.log. And every time I boot, Its file permission is changed to default (unwritable) by the system. So, i have to run chmod command every time i boot-up. How to change it's file permission permanently.

Question - why? What is it you are trying to do that requires write access? Normal logging processes are generally recommended.
–
Rory AlsopMar 30 '11 at 12:10

@RoryAlsop to debug ajax, i need to check into error.log. And this is so full of logs. I normally delete it, and look for changes. But due to it's permission, is not editable.
–
Santosh LinkhaMar 30 '11 at 12:15

@explorex - good range of tools allow you to manage logs without deleting. I always use a combination of grep and tail, which makes life very easy.
–
Rory AlsopMar 30 '11 at 12:22

If so, try editing the configuration file /etc/logrotate.d/apache2, and change

create 640 root adm

to whatever you prefer, e.g.

create 666 root adm

But other than the apache2 service, what else needs to write to this file?

If this is on a server, it's probably a bad idea to make the file world writable. For example, if somebody breaks in to your system, they can remove the log entries that would help you find the problem.

If you want read access, it might be better to add yourself to the adm group, e.g.

The usual reason is letting some customers or some software (traffic analysis, monitoring) access to the logs without granting it extra privileges that could be a security risk.
–
Javier RiveraMar 30 '11 at 10:48