Commit 772865cb authored by koennecke's avatar koennecke
Browse files

Prepared gelf branch for production usage

parent 8a5c62ac
......@@ -98,12 +98,13 @@ static int MongoConfigAction(SConnection * pCon, SicsInterp * pSics,
strtolower(argv[1]);
if(strcmp(argv[1],"open") == 0){
if(argc < 3){
SCWrite(pCon,"ERROR: need mongourl and instrument parameters for open",eError);
if(argc < 4){
SCWrite(pCon,"ERROR: need mongourl, dbName and instrument parameters for open",eError);
return 0;
}
strncpy(mongoURL,argv[2],sizeof(mongoURL));
strncpy(inst, argv[3],sizeof(inst));
strncpy(logDB,argv[3],sizeof(logDB));
strncpy(inst, argv[4],sizeof(inst));
mongoc_init();
client = mongoc_client_new (mongoURL);
if(!client){
......
......@@ -5,7 +5,7 @@
*
* Mark Koennecke, February 2016
*
* Modified to allow for GELF standrad logging and the new organisation with one DB and multiple collections
* Modified to allow for GELF standard logging and the new organisation with one DB and multiple collections
*
* Mark Koennecke, May 2017
*/
......@@ -18,7 +18,7 @@
static char lastError[1024];
static char mongoURL[1024];
static char inst[132];
static char logDB[] = "sinqTestDB";
static char logDB[132];
static mongoc_client_t *client;
static mongoc_collection_t *collection;
......@@ -35,6 +35,8 @@ char * sicslogGetError(void)
int sicslogSetup(char *url, char *instPar)
{
memset(inst,0,sizeof(inst));
strcpy(logDB,"sinqProdDB01");
/* strcpy(logDB,"sinqTestDB"); */
if(instPar != NULL){
strncpy(inst,instPar, sizeof(inst));
......
......@@ -60,7 +60,10 @@ int main(int argc, char *argv[])
int status;
char *error;
sicslogSetup("mongodb://userRW:2yfbt4AwBw4RY7j@mgdbaas001:27017,mgdbaas002:27017,mgdbaas003:27017/testDB?replicaSet=rs_prod-DataScience-01&connectTimeoutMS=300&authSource=sinqTestDB",NULL);
/*
sicslogSetup("mongodb://userRW:2yfbt4AwBw4RY7j@mgdbaas001:27017,mgdbaas002:27017,mgdbaas003:27017/testDB?replicaSet=rs_prod-DataScience-01&connectTimeoutMS=300&authSource=sinqTestDB",NULL);
*/
sicslogSetup("mongodb://sinqUserRW:8Mh7]YFUE6JP]dQ7@mgdbaas001:27017,mgdbaas002:27017,mgdbaas003:27017/sinqProdDB01?replicaSet=rs_prod-DataScience-01&connectTimeoutMS=300&authSource=sinqProdDB01",NULL);
status = sicslogQuery(argc,argv,ResultPrint,NULL);
if(status != 0){
error = sicslogGetError();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment