package com.huawei.esdk.fusionmanager.local.impl.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.log4j.Logger;

public class LogFileUploader
{
    private static final Logger LOGGER = Logger.getLogger(LogFileUploader.class);
    
    //private String logServerURL;
    
    private ExecutorService es = Executors.newFixedThreadPool(1);
    
    public void init(String logServerURL)
    {
        //logServerURL = LogUtil.getInstance().getLog_Url();
        
        if (!StringUtils.isEmpty(logServerURL))
        {
            //LogFileUploaderTask logFileUploaderTask = new LogFileUploaderTask();
            //logFileUploaderTask.uploadLogFiles();
            es.execute(new LogFileUploaderTask());
            LOGGER.info("The Log uploader thread started");
        }
    }
    
    public void destroy()
    {
        es.shutdownNow();
    }
}
