I installed Ckan from source on debian with apache following official doc and all it's ok but all ckan info logs are wrote to the error log file.
This is my virtualhost:
<VirtualHost *:80>
ServerName ckan.mydomain.com
ServerAlias ckan.mydomain.com
WSGIScriptAlias / /etc/ckan/default/apache.wsgi
# Pass authorization info on (needed for rest api).
WSGIPassAuthorization On
# Deploy as a daemon (avoids conflicts between CKAN instances).
WSGIDaemonProcess ckan_default display-name=ckan_default processes=2 threads=15
WSGIProcessGroup ckan_default
ErrorLog /var/log/apache2/ckan_default.error.log
CustomLog /var/log/apache2/ckan_default.custom.log combined
<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
</IfModule>
</VirtualHost>
This is a line of my ckan_default.error.log:
<[Thu Oct 15 10:47:48.797562 2015] [:error] [pid 14100] 2015-10-15 10:47:48,797 INFO [ckan.lib.base] /ckan-admin render time 0.085 seconds>
Why is there [:error] and why is this line in ckan_default.error.log?
Thanks. Alex
CKAN's default config simply sends logs to stderr, as can be seen in the ckan/config/deployment.ini_tmpl:
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
Apache saves stderr to its ErrorLog, hence why you see it in ckan_default.error.log.
Apache's docs say that this is:
where Apache httpd will send diagnostic information and record any errors that it encounters
So I think it's not too crazy to include CKAN's INFO messages there alongside its WARNINGs (non-fatal errors) and ERRORs.
CKAN's default set-up is designed to be the simplest possible way, which is why the file handler was removed in this commit: https://github.com/ckan/ckan/commit/6e1d325d61e
But of course it's a compromise and all suggestions are welcome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With