Add log retrieval to Redis
Redis stores logs in a file defined its configuration file. This patch adds access to log messages from Redis log file by searching for the filepath in the configuration. Change-Id: Ib9c97173ec001a002f8a9af111963849ce9208ad
This commit is contained in:
parent
7bf1b28703
commit
c2911f5525
@ -22,8 +22,9 @@ from trove.common.notification import EndNotification
|
||||
from trove.common import utils
|
||||
from trove.guestagent import backup
|
||||
from trove.guestagent.common import operating_system
|
||||
from trove.guestagent.datastore.experimental.redis import service
|
||||
from trove.guestagent.datastore.experimental.redis import service, system
|
||||
from trove.guestagent.datastore import manager
|
||||
from trove.guestagent import guest_log
|
||||
from trove.guestagent import volume
|
||||
|
||||
|
||||
@ -36,6 +37,8 @@ class Manager(manager.Manager):
|
||||
based off of the service_type of the trove instance
|
||||
"""
|
||||
|
||||
GUEST_LOG_DEFS_REDIS_LABEL = 'redis'
|
||||
|
||||
def __init__(self):
|
||||
super(Manager, self).__init__('redis')
|
||||
self._app = service.RedisApp()
|
||||
@ -48,6 +51,19 @@ class Manager(manager.Manager):
|
||||
def configuration_manager(self):
|
||||
return self._app.configuration_manager
|
||||
|
||||
@property
|
||||
def datastore_log_defs(self):
|
||||
logfile = self._app.get_logfile()
|
||||
if not logfile:
|
||||
return {}
|
||||
return {
|
||||
self.GUEST_LOG_DEFS_REDIS_LABEL: {
|
||||
self.GUEST_LOG_TYPE_LABEL: guest_log.LogType.SYS,
|
||||
self.GUEST_LOG_USER_LABEL: system.REDIS_OWNER,
|
||||
self.GUEST_LOG_FILE_LABEL: logfile
|
||||
}
|
||||
}
|
||||
|
||||
def _perform_restore(self, backup_info, context, restore_location, app):
|
||||
"""Perform a restore on this instance."""
|
||||
LOG.info("Restoring database from backup %s.", backup_info['id'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user