Commit cf1cbf35 authored by Alejandro Alvarez Ayllon's avatar Alejandro Alvarez Ayllon
Browse files

FTS-26: Start logging from inside the application

- The WSGI script explicitly loads the logging configuration
- Provide better default configuration for logging
- Create logging folder on installation
parent c61d21ed
......@@ -102,6 +102,7 @@ mkdir -p %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/%{_var}/cache/fts3rest/
mkdir -p %{buildroot}/%{_var}/log/fts3rest/
%clean
rm -rf %{buildroot}
......@@ -113,6 +114,7 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/fts3/fts3rest.ini
%config(noreplace) %{_sysconfdir}/httpd/conf.d/fts3rest.conf
%dir %attr(0775,apache,apache) %{_var}/cache/fts3rest
%dir %attr(0775,apache,apache) %{_var}/log/fts3rest
%files cli
%defattr(-,root,root,-)
......@@ -122,6 +124,9 @@ rm -rf %{buildroot}
%files selinux
%changelog
* Mon Mar 10 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.2.0-1
- Creating log directory
* Mon Jan 03 2014 Alejandro Álvarez <aalvarez@cern.ch> - 3.1.0-1
- Major and minor versions follow FTS3
......
[DEFAULT]
debug = true
debug = false
# Uncomment and replace with the address which should receive any error reports
#email_to = you@yourdomain.com
smtp_server = localhost
......@@ -44,14 +44,14 @@ fts3.config = /etc/fts3/fts3config
keys = root, routes, fts3rest, sqlalchemy
[handlers]
keys = console
keys = console, log_file
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
handlers = log_file
[logger_routes]
level = INFO
......@@ -65,7 +65,7 @@ handlers =
qualname = fts3rest
[logger_sqlalchemy]
level = INFO
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
......@@ -78,7 +78,14 @@ args = (sys.stderr,)
level = NOTSET
formatter = generic
[handler_log_file]
# See
# http://docs.python.org/2/library/logging.handlers.html#timedrotatingfilehandler
class = logging.handlers.TimedRotatingFileHandler
args = ('/var/log/fts3rest/fts3rest.log', 'D', 1)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] [%(threadName)s] %(message)s
datefmt = %H:%M:%S
#!/usr/bin/env python
from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig
fileConfig('/etc/fts3/fts3rest.ini')
application = loadapp('config:/etc/fts3/fts3rest.ini')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment