'''
Created on 12 Feb 2021

@author Saurabh Kumar Pandey

FLUENT_IP, FLUENT_PORT, array("socket_timeout" => FLUENT_SOK_TO,
                "connection_timeout" => FLUENT_CN_TO,
                "persistent" => FLUENT_PER,
                "retry_socket" => FLUENT_RETRY_SOC,
                "max_write_retry" => FLUENT_MAX_RETRY)

'''

#from fluent import sender
from fluent import asyncsender as sender
import time

from configparser import ConfigParser
config_object = ConfigParser()
config_object.read("/opt/rmq-workers/config.ini")
fluent_config = config_object["fluent"]

def fluentdLog(methodName='default',daata=None):
    return
    try:
        logger = sender.FluentSender(methodName, host=fluent_config['host'], port=int(fluent_config['port']),timeout=1.0)        
        try:
            logger.emit('ACCOUNTS_WORKER_PROD_DELHI', {methodName:daata})
            logger.close()
        except Exception as de:
            print('LogData not correct')        
    except Exception as err:
        print('connection error')
