diff options
author | Kevin McCarthy <kmccarth@redhat.com> | 2007-10-17 16:45:20 -0700 |
---|---|---|
committer | Kevin McCarthy <kmccarth@redhat.com> | 2007-10-17 16:45:20 -0700 |
commit | 6249f20526006c3576fb099491132d403bb66cbe (patch) | |
tree | 27e6e3a3743718fe9bf101b849d553f68afede1f /ipa-server | |
parent | 4718fc6dff9ac3ed5b506e116aad2bdd02e18c21 (diff) | |
download | freeipa-6249f20526006c3576fb099491132d403bb66cbe.tar.gz freeipa-6249f20526006c3576fb099491132d403bb66cbe.tar.xz freeipa-6249f20526006c3576fb099491132d403bb66cbe.zip |
Add logger objects to each controller.
Fix up the config settings for logging.
Diffstat (limited to 'ipa-server')
-rw-r--r-- | ipa-server/ipa-gui/ipagui/config/log.cfg | 5 | ||||
-rw-r--r-- | ipa-server/ipa-gui/ipagui/controllers.py | 8 | ||||
-rw-r--r-- | ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py | 3 | ||||
-rw-r--r-- | ipa-server/ipa-gui/ipagui/subcontrollers/group.py | 3 | ||||
-rw-r--r-- | ipa-server/ipa-gui/ipagui/subcontrollers/ipacontroller.py | 3 | ||||
-rw-r--r-- | ipa-server/ipa-gui/ipagui/subcontrollers/user.py | 3 | ||||
-rw-r--r-- | ipa-server/ipa-gui/sample-prod.cfg | 10 |
7 files changed, 26 insertions, 9 deletions
diff --git a/ipa-server/ipa-gui/ipagui/config/log.cfg b/ipa-server/ipa-gui/ipagui/config/log.cfg index ce776f850..483069cd7 100644 --- a/ipa-server/ipa-gui/ipagui/config/log.cfg +++ b/ipa-server/ipa-gui/ipagui/config/log.cfg @@ -10,6 +10,9 @@ format='*(message)s' [[[full_content]]] format='*(asctime)s *(name)s *(levelname)s *(message)s' +[[[datestamped]]] +format='*(asctime)s *(message)s' + [[handlers]] [[[debug_out]]] class='StreamHandler' @@ -21,7 +24,7 @@ formatter='full_content' class='StreamHandler' level='INFO' args='(sys.stdout,)' -formatter='message_only' +formatter='datestamped' [[[error_out]]] class='StreamHandler' diff --git a/ipa-server/ipa-gui/ipagui/controllers.py b/ipa-server/ipa-gui/ipagui/controllers.py index f2b7bb909..1025b6c36 100644 --- a/ipa-server/ipa-gui/ipagui/controllers.py +++ b/ipa-server/ipa-gui/ipagui/controllers.py @@ -1,3 +1,5 @@ +import logging + import cherrypy import turbogears from turbogears import controllers, expose, flash @@ -5,9 +7,6 @@ from turbogears import validators, validate from turbogears import widgets, paginate from turbogears import error_handler from turbogears import identity -# from model import * -# import logging -# log = logging.getLogger("ipagui.controllers") import ipa.config import ipa.ipaclient @@ -18,7 +17,10 @@ from subcontrollers.delegation import DelegationController ipa.config.init_config() +log = logging.getLogger(__name__) + class Root(controllers.RootController): + user = UserController() group = GroupController() delegate = DelegationController() diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py b/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py index c732e8f85..e0ee6ba4f 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/delegation.py @@ -2,6 +2,7 @@ import os from pickle import dumps, loads from base64 import b64encode, b64decode import copy +import logging import cherrypy import turbogears @@ -19,6 +20,8 @@ import ipa.aci import ldap.dn +log = logging.getLogger(__name__) + aci_fields = ['*', 'aci'] delegate_form = ipagui.forms.delegate.DelegateForm() diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/group.py b/ipa-server/ipa-gui/ipagui/subcontrollers/group.py index 1050a5599..b776c8108 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/group.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/group.py @@ -1,5 +1,6 @@ from pickle import dumps, loads from base64 import b64encode, b64decode +import logging import cherrypy import turbogears @@ -16,6 +17,8 @@ from ipa.entity import utf8_encode_values from ipa import ipaerror import ipagui.forms.group +log = logging.getLogger(__name__) + group_new_form = ipagui.forms.group.GroupNewForm() group_edit_form = ipagui.forms.group.GroupEditForm() diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/ipacontroller.py b/ipa-server/ipa-gui/ipagui/subcontrollers/ipacontroller.py index 425df0074..6a8383a58 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/ipacontroller.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/ipacontroller.py @@ -1,4 +1,5 @@ import os +import logging import cherrypy import turbogears @@ -11,6 +12,8 @@ from turbogears import identity import ipa.ipaclient import ipa.config +log = logging.getLogger(__name__) + ipa.config.init_config() class IPAController(controllers.Controller): diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py index d7ae49796..2f7f47226 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py @@ -2,6 +2,7 @@ import re import random from pickle import dumps, loads from base64 import b64encode, b64decode +import logging import cherrypy import turbogears @@ -17,6 +18,8 @@ from ipa.entity import utf8_encode_values from ipa import ipaerror import ipagui.forms.user +log = logging.getLogger(__name__) + password_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" user_new_form = ipagui.forms.user.UserNewForm() diff --git a/ipa-server/ipa-gui/sample-prod.cfg b/ipa-server/ipa-gui/sample-prod.cfg index a12662706..f8416b93a 100644 --- a/ipa-server/ipa-gui/sample-prod.cfg +++ b/ipa-server/ipa-gui/sample-prod.cfg @@ -1,7 +1,7 @@ [global] # DATABASE -# no database for ipa-webgui since everything is stored in LDAP +# no database for ipagui since everything is stored in LDAP # IDENTITY @@ -59,19 +59,19 @@ server.thread_pool = 10 [[[access_out]]] # set the filename as the first argument below -args="('ipa-webgui',)" +args="('ipagui',)" class='FileHandler' level='INFO' -formatter='message_only' +formatter='datestamped' [[loggers]] [[[ipagui]]] level='ERROR' -qualname='ipa-webgui' +qualname='ipagui' handlers=['debug_out'] [[[access]]] level='INFO' -qualname='ipa-webgui.access' +qualname='turbogears.access' handlers=['access_out'] propagate=0 |