summaryrefslogtreecommitdiffstats
path: root/ipapython/ipa_log_manager.py
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2011-11-30 11:08:42 -0500
committerMartin Kosek <mkosek@redhat.com>2011-12-01 08:34:02 +0100
commit167813f34350466be569be26f4faa8b9a05e5920 (patch)
treee9df21a77042214ff5416c6e475d61378185e296 /ipapython/ipa_log_manager.py
parent27931dcb29ebeb15aae4d17d745252ba75f69bae (diff)
downloadfreeipa-167813f34350466be569be26f4faa8b9a05e5920.tar.gz
freeipa-167813f34350466be569be26f4faa8b9a05e5920.tar.xz
freeipa-167813f34350466be569be26f4faa8b9a05e5920.zip
Restore default log level in server to INFO
The default log level for server messages captured by httpd's error_log historically was INFO. The log_manager patch had it set to ERROR, this patch resets it back to INFO. Although it would have been trival to set the default_level to INFO in IPALogManager.configure_from_env() that is not logically the correct place. It would be much better if the default_level can be reset by simply assigning it to the log_mgr. To accomplish that LogManager.default_level was converted to a property with a getter and setter. The setter runs LogManager.apply_configuratin() after the default_level is modified. LogManager.set_default_level() was also added to allow simultaneously updating the configure_state. While testing some minor problems were observed and also fixed: * Removed some print statement which had been left in by mistake * Removed the ability to set the handler level in the config file because of chicken-and-egg issues of when handlers get created. The Env config file format is too inflexible to support detailed logging configuration. If the Env config format is ever made more flexible we can come back and add this back in. The handler config setting in Env had never been used and never worked so there is no issue in removing it.
Diffstat (limited to 'ipapython/ipa_log_manager.py')
-rw-r--r--ipapython/ipa_log_manager.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/ipapython/ipa_log_manager.py b/ipapython/ipa_log_manager.py
index 11e30d11a..7841eabfb 100644
--- a/ipapython/ipa_log_manager.py
+++ b/ipapython/ipa_log_manager.py
@@ -75,7 +75,6 @@ class IPALogManager(LogManager):
'''
log_logger_level_config_re = re.compile(r'^log_logger_level_(debug|info|warn|warning|error|critical|\d+)$')
- log_handler_level_config_re = re.compile(r'^log_handler_(\S+)_level$')
def __init__(self, configure_state=None):
'''
@@ -117,37 +116,11 @@ class IPALogManager(LogManager):
will usually need to escape the dot in the logger names by
preceeding it with a backslash.
- Handler Levels
- *log_handler_XXX_level = level*
-
- Handler levels may be specified with a key containing the
- name of the handler (XXX) and whose value is the level. For
- example::
-
- log_handler_console_level = debug
-
- Would set the console handler level to debug.
-
- These are the predefined log handlers:
-
- console
- Writes to stderr.
- file
- Writes to the default log file.
-
-
The return value of this function is a dict with the following
format:
logger_regexps
List of (regexp, level) tuples
- handlers
- Dict, key is handler name, value is dict of handler config.
-
- Handler config dict:
-
- level
- handler log level
:parameters:
env
@@ -158,9 +131,7 @@ class IPALogManager(LogManager):
use configure_state to track the state of the log manager.
'''
logger_regexps = []
- handlers = {}
config = {'logger_regexps' : logger_regexps,
- 'handlers' : handlers,
}
for attr in ('debug', 'verbose'):
@@ -178,27 +149,9 @@ class IPALogManager(LogManager):
regexps = re.split('\s*,\s*', value)
# Add the regexp, it maps to the configured level
for regexp in regexps:
- print "%s %s" % (regexp, level)
logger_regexps.append((regexp, level))
continue
- # Get handler configuration
- match = IPALogManager.log_handler_level_config_re.search(attr)
- if match:
- value = getattr(env, attr)
- try:
- level = parse_log_level(value)
- except Exception, e:
- print >>sys.stderr, 'ERROR could not parse log handler level: %s=%s' % (attr, value)
- continue
- name = match.group(1)
- print "%s %s" % (name, level)
- handler_config = handlers.get(name)
- if handler_config is None:
- handler_config = {'name' : name}
- handler_config['level'] = level
- continue
-
self.configure(config, configure_state)
return config