Sonar Fixes: Variable name changes
[aaf/authz.git] / auth / auth-core / src / main / java / org / onap / aaf / auth / server / Log4JLogIt.java
index 894f571..284a7de 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,7 @@ import org.onap.aaf.misc.env.util.Chrono;
 public class Log4JLogIt implements LogIt {
     protected static final String AAF_LOG4J_PREFIX = "aaf_log4j_prefix";
     // Log4j does it's own date.  Can't apparently turn it off.
-    
+
     private final String service;
     private final String audit;
     private final String init;
@@ -49,10 +49,10 @@ public class Log4JLogIt implements LogIt {
 
     public Log4JLogIt(final String[] args, final String root) throws APIException {
         String propsFile = getArgOrVM(AAF_LOG4J_PREFIX, args, "org.osaaf.aaf")+".log4j.props";
-        String log_dir = getArgOrVM(Config.CADI_LOGDIR,args,"/opt/app/osaaf/logs");
-        String etc_dir = getArgOrVM(Config.CADI_ETCDIR,args,"/opt/app/osaaf/etc");
-        String log_level = getArgOrVM(Config.CADI_LOGLEVEL,args,"INFO");
-        File logs = new File(log_dir);
+        String logDir = getArgOrVM(Config.CADI_LOGDIR,args,"/opt/app/osaaf/logs");
+        String etcDir = getArgOrVM(Config.CADI_ETCDIR,args,"/opt/app/osaaf/etc");
+        String logLevel = getArgOrVM(Config.CADI_LOGLEVEL,args,"INFO");
+        File logs = new File(logDir);
         if (!logs.isDirectory()) {
             logs.delete();
         }
@@ -61,9 +61,9 @@ public class Log4JLogIt implements LogIt {
         }
 
         if (System.getProperty("log4j.configuration")==null) {
-            System.setProperty("log4j.configuration", etc_dir+'/'+propsFile);
+            System.setProperty("log4j.configuration", etcDir+'/'+propsFile);
         }
-        LogFileNamer lfn = new LogFileNamer(log_dir,root);
+        LogFileNamer lfn = new LogFileNamer(logDir,root);
         try {
             service=lfn.setAppender("service"); // when name is split, i.e. authz|service, the Appender is "authz", and "service"
             audit=lfn.setAppender("audit");     // is part of the log-file name
@@ -74,13 +74,13 @@ public class Log4JLogIt implements LogIt {
             laudit = Logger.getLogger(audit);
             linit = Logger.getLogger(init);
             ltrace = Logger.getLogger(trace);
-    
-            lfn.configure(etc_dir,propsFile, log_level);
+
+            lfn.configure(etcDir,propsFile, logLevel);
         } catch (IOException e) {
             throw new APIException(e);
         }
     }
-    
+
     private static final String getArgOrVM(final String tag, final String args[], final String def) {
         String tagEQ = tag + '=';
         String value;
@@ -91,10 +91,10 @@ public class Log4JLogIt implements LogIt {
         }
         // check System.properties
         value = System.getProperty(tag);
-        if (value!=null) { 
+        if (value!=null) {
             return value;
         }
-        
+
         return def;
     }
 
@@ -127,7 +127,7 @@ public class Log4JLogIt implements LogIt {
             default:
                 lservice.info(PropAccess.buildMsg(service, Chrono.utcFmt, level, elements));
                 break;
-        
+
         }
 
     }