summaryrefslogtreecommitdiffstats
path: root/auth/auth-locate/src/main
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-04-03 21:30:32 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-04-03 21:30:38 -0500
commitabf7c0e407c97250c07d408c314c5aa1c757263e (patch)
treebf37f2b5872c4f8f756a3b2a08abf907ec1c6ce1 /auth/auth-locate/src/main
parenta88f56fb9096afa3d48ff9d71190cec49d2b6673 (diff)
Create method of Logging to O/S from Container
Issue-ID: AAF-211 Change-Id: Ib5c369c24082823f6f8cfde7609b966f57085665 Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-locate/src/main')
-rw-r--r--auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/AAF_Locate.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/AAF_Locate.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/AAF_Locate.java
index 92fc88c7..31f67726 100644
--- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/AAF_Locate.java
+++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/AAF_Locate.java
@@ -22,6 +22,7 @@
package org.onap.aaf.auth.locate;
+import java.io.File;
import java.net.URI;
import java.util.Map;
@@ -46,6 +47,7 @@ import org.onap.aaf.auth.locate.mapper.Mapper.API;
import org.onap.aaf.auth.rserv.HttpMethods;
import org.onap.aaf.auth.server.AbsService;
import org.onap.aaf.auth.server.JettyServiceStarter;
+import org.onap.aaf.auth.server.Log4JLogIt;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.Locator;
import org.onap.aaf.cadi.LocatorException;
@@ -230,10 +232,21 @@ public class AAF_Locate extends AbsService<AuthzEnv, AuthzTrans> {
}
public static void main(final String[] args) {
- PropAccess propAccess = new PropAccess(args);
try {
+ String propsFile = getArg(AAF_LOG4J_PREFIX, args, "org.osaaf")+".log4j.props";
+ String log_dir = getArg(Config.CADI_LOGDIR,args,"./logs");
+ String log_level = getArg(Config.CADI_LOGLEVEL,args,"INFO");
+ File logs = new File(log_dir);
+ if(!logs.isDirectory()) {
+ logs.delete();
+ }
+ if(!logs.exists()) {
+ logs.mkdirs();
+ }
+ Log4JLogIt logIt = new Log4JLogIt(log_dir,log_level,propsFile, "locate");
+ PropAccess propAccess = new PropAccess(logIt,args);
+
AAF_Locate service = new AAF_Locate(new AuthzEnv(propAccess));
-// service.env().setLog4JNames("log4j.properties","authz","gw","audit","init","trace");
JettyServiceStarter<AuthzEnv,AuthzTrans> jss = new JettyServiceStarter<AuthzEnv,AuthzTrans>(service);
jss.start();
} catch (Exception e) {