mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
chg: [logs] add syslog level + facility + script startup message
This commit is contained in:
parent
cdbb8cba35
commit
2d2e4a653e
3 changed files with 23 additions and 3 deletions
|
@ -119,6 +119,14 @@ function launching_logs {
|
|||
syslog_cmd="${syslog_cmd} -sp ${syslog_port}"
|
||||
fi
|
||||
fi
|
||||
syslog_facility=`cat $conf_dir/core.cfg | grep 'ail_logs_syslog_facility' | cut -d " " -f 3 `
|
||||
if [ ! -z "$syslog_facility" -a "$str" != " " ]; then
|
||||
syslog_cmd="${syslog_cmd} -sf ${syslog_facility}"
|
||||
fi
|
||||
syslog_level=`cat $conf_dir/core.cfg | grep 'ail_logs_syslog_level' | cut -d " " -f 3 `
|
||||
if [ ! -z "$syslog_level" -a "$str" != " " ]; then
|
||||
syslog_cmd="${syslog_cmd} -sl ${syslog_level}"
|
||||
fi
|
||||
|
||||
screen -dmS "Logging_AIL"
|
||||
sleep 0.1
|
||||
|
|
|
@ -43,7 +43,6 @@ sys.path.append(os.environ['AIL_BIN'])
|
|||
from modules.abstract_module import AbstractModule
|
||||
from lib.ConfigLoader import ConfigLoader
|
||||
|
||||
|
||||
class Global(AbstractModule):
|
||||
"""
|
||||
Global module for AIL framework
|
||||
|
@ -52,7 +51,9 @@ class Global(AbstractModule):
|
|||
def __init__(self):
|
||||
super(Global, self).__init__()
|
||||
|
||||
self.r_stats = ConfigLoader().get_redis_conn("ARDB_Statistics")
|
||||
config_loader = ConfigLoader()
|
||||
self.r_stats = config_loader.get_redis_conn("ARDB_Statistics")
|
||||
self.r_serv_db = config_loader.get_redis_conn("ARDB_DB")
|
||||
|
||||
self.processed_item = 0
|
||||
self.time_last_stats = time.time()
|
||||
|
@ -68,6 +69,11 @@ class Global(AbstractModule):
|
|||
|
||||
# Send module state to logs
|
||||
self.redis_logger.info(f"Module {self.module_name} initialized")
|
||||
# Send module state to logs
|
||||
self.redis_logger.critical(f"AIL {self.get_ail_uuid()} started")
|
||||
|
||||
def get_ail_uuid(self):
|
||||
return self.r_serv_db.get('ail:uuid')
|
||||
|
||||
|
||||
def computeNone(self):
|
||||
|
@ -208,7 +214,7 @@ class Global(AbstractModule):
|
|||
|
||||
return curr_file_content
|
||||
|
||||
# # TODO: add stats incomplete_file/Not a gzipped file
|
||||
# # TODO: add stats incomplete_file/Not a gzipped file
|
||||
def gunzip_bytes_obj(self, filename, bytes_obj):
|
||||
gunzipped_bytes_obj = None
|
||||
try:
|
||||
|
|
|
@ -24,9 +24,15 @@ sentiment_lexicon_file = sentiment/vader_lexicon.zip/vader_lexicon/vader_lexicon
|
|||
|
||||
##### Logs ######
|
||||
[Logs]
|
||||
# activate syslog
|
||||
ail_logs_syslog = False
|
||||
ail_logs_syslog_server =
|
||||
# default=514
|
||||
ail_logs_syslog_port =
|
||||
# ['auth', 'authpriv', 'cron', 'daemon', 'ftp', 'kern', 'lpr', 'mail', 'news', 'syslog', 'user', 'uucp', 'local0', 'local1', 'local2', 'local3', 'local4', 'local5', 'local6', 'local7']
|
||||
ail_logs_syslog_facility =
|
||||
# ['DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL']
|
||||
ail_logs_syslog_level =
|
||||
|
||||
##### Notifications ######
|
||||
[Notifications]
|
||||
|
|
Loading…
Reference in a new issue