@type: logging.getLogger
'''
+ self.global_option = {}
+ '''
+ @ivar: all global options
+ @type: dict
+ '''
+
if not logger:
#################################################
return False
if self.verbose > 4:
self.logger.debug(
- ( _("Setting '%(option)s' in '%(directive)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)")
+ ( _("Setting global option '%(option)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)")
% {'option': key, 'directive': directive_str, 'value': str(val), 'file': filename, 'lnr': linenr})
)
- directive[key] = val
+ self.global_option[key] = val
return True
# Check for rotation period
import gettext
import logging
import pprint
+import os
+import os.path
from LogRotateConfig import LogrotateConfigurationError
from LogRotateConfig import LogrotateConfigurationReader
self.logger.error( str(e) )
sys.exit(10)
+ if self.state_file is None:
+ if 'statusfile' in config_reader.global_option and \
+ config_reader.global_option['statusfile'] is not None:
+ self.state_file = config_reader.global_option['statusfile']
+ else:
+ self.state_file = os.sep + os.path.join('var', 'lib', 'py-logrotate.status')
+
+ if self.pid_file is None:
+ if 'pidfile' in config_reader.global_option and \
+ config_reader.global_option['pidfile'] is not None:
+ self.pid_file = config_reader.global_option['pidfile']
+ else:
+ self.pid_file = os.sep + os.path.join('var', 'run', 'py-logrotate.pid')
+
return True
+ #------------------------------------------------------------
+
+
#========================================================================
if __name__ == "__main__":
verbose = verbose_level,
force = opt_parser.options.force,
state_file = opt_parser.options.statefile,
+ pid_file = opt_parser.options.pidfile,
mail_cmd = opt_parser.options.mailcmd,
local_dir = local_dir,
)
msgid "Value '%(value)s' for option '%(option)s' is not an absolute path."
msgstr "Der Wert »%(value)s« für die Option »%(option)s« ist keine absolute Pfadangabe."
+#: LogRotateConfig.py:1083
+msgid "Setting global option '%(option)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)"
+msgstr ""
+"Setze globale Option »%(option)s auf »%(value)s«. "
+"(Datei »%(file)s«, Zeile %(lnr)s)"
+
#: LogRotateConfig.py:1077
#, python-format
msgid ""
msgid "Value '%(value)s' for option '%(option)s' is not an absolute path."
msgstr ""
+#: LogRotateConfig.py:1083
+#, python-format
+msgid "Setting global option '%(option)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)"
+msgstr ""
+
#: LogRotateConfig.py:1077
#, python-format
msgid "Setting '%(option)s' in '%(directive)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)"
# Contributes by Chuck Short
#
+
/var/log/apache2/access_log
/var/log/apache2/*.log
{