package com.sldlt.scheduled;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.amazonaws.services.s3.AmazonS3;
import com.sldlt.navps.service.NAVPSExporterService;

@Component
@Profile("aws")
public class DataExporter {

    private static final Logger LOG = Logger.getLogger(DataExporter.class);

    @Value("${dataexporter.s3.bucket.name}")
    private String bucketName;

    @Value("${dataexporter.s3.bucket.path}")
    private String path;

    @Value("${dataexporter.csv.filename}")
    private String csvFilename;

    @Value("${dataexporter.json.filename}")
    private String jsonFilename;

    @Autowired
    private AmazonS3 amazonS3;

    @Autowired
    private NAVPSExporterService navpsExporterService;

    @Scheduled(cron = "${dataexporter.cron:0 0 5 * * *}", zone = "${dataexporter.zone:GMT+8}")
    public void run() {
        LOG.info("Uploading NAVPS to " + bucketName + "/" + path + csvFilename);
        amazonS3.putObject(bucketName, path + csvFilename, navpsExporterService.buildNavpsCsvContent());

        LOG.info("Uploading NAVPS to " + bucketName + "/" + path + jsonFilename);
        amazonS3.putObject(bucketName, path + jsonFilename, navpsExporterService.buildNavpsJsonContent());
    }

}

@@ -1111,16 +1111,55 @@
 run() %7B%0A
+        if (LOG.isInfoEnabled()) %7B%0A    
         
@@ -1223,32 +1223,42 @@
 + csvFilename);%0A
+        %7D%0A
         amazonS3
@@ -1343,24 +1343,63 @@
 ontent());%0A%0A
+        if (LOG.isInfoEnabled()) %7B%0A    
         LOG.
@@ -1460,32 +1460,42 @@
  jsonFilename);%0A
+        %7D%0A
         amazonS3

add logging guard statement