How to config custom location for rendering/cache/info/exception logs

Asked by Toni Moreno

Hi.

I would like to move all default graphite-web logs

cache.log
exception.log
rendering.log
info.log

 from its default location at

/opt/graphite/storage/log/webapp

to other custom location:

How can I do it?

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Toni Moreno
Solved:
Last query:
Last reply:
Revision history for this message
Jason Dixon (jason-dixongroup) said :
#1

The easiest way is to just move the files and symlink them. The LOG_DIR environment variable can also be set for both (or either) graphte-web and carbon.

Revision history for this message
Toni Moreno (toni-moreno) said :
#2

Could be interesting to add it as a new parameter in local_settings.py

In the meanwhile I've tested SetEnv On the apache.conf file but it doesn't work

<VirtualHost *:9090>
        ServerName graphite
        DocumentRoot "/opt/graphite/webapp"
        ErrorLog /logs/apps/graphite/webapp/error.log
        CustomLog /logs/apps/graphite/webapp/access.log combined

        SetEnv LOG_DIR /logs/apps/graphite/webapp/

        WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
        WSGIProcessGroup graphite
        WSGIApplicationGroup %{GLOBAL}
        WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL}
 ...
...
...
</virtualhost>

I've also tried to set LOG_DIR on the shell

export LOG_DIR=/logs/apps/graphite/webapp/
/etc/init.d/apache stop
/etc/init.d/apache start

and doesn't work yet

Revision history for this message
Toni Moreno (toni-moreno) said :
#3

Sorry Jason. I didn't understand you.

 I've finally found the LOG_DIR in /opt/graphite/webapp/graphite/local_settings.py

Thank you