[84929][85032][85034]fix syslog set/get log level, default file count and size

Change-Id: I56929b9b4a403c15650656fcaa8eab428e4d33bf
diff --git a/mbtk/mbtk_logd/main.c b/mbtk/mbtk_logd/main.c
index e47bdca..edc5375 100755
--- a/mbtk/mbtk_logd/main.c
+++ b/mbtk/mbtk_logd/main.c
@@ -14,7 +14,7 @@
 #include "json/printbuf.h"
 #include "log_config.h"
 
-// #define DEBUG 1
+//#define DEBUG 1
 
 #ifdef DEBUG
 #define mbtk_log(...)                    printf(__VA_ARGS__)
@@ -67,7 +67,7 @@
     json_object* fileterjson = NULL;
     json_object* fileter_listjson = NULL;
     log_config_entry* entry;
-    int i, n, ret;
+    int i, n, ret, array_length;
     char* cmdval = NULL;
 
     printf("MBTK_LOGD: in parse_config\n");
@@ -145,7 +145,8 @@
         entry->filter_list = (struct filter_list_t*)malloc(sizeof(struct filter_list_t));
         _filter_list = entry->filter_list;
 
-        for (n = 0 ; n < 5; n++) {
+        array_length = json_object_array_length(listjson);
+        for (n = 0 ; n <= array_length; n++) {
             fileterjson = json_object_array_get_idx(listjson, n);
             if (NULL == fileterjson) {
                 mbtk_log("the fileterjson exit\n");
@@ -169,6 +170,10 @@
                 _filter_list->tag = strdup(str);
                 mbtk_log("fileter_listjson: %s\n", _filter_list->tag);
             }
+            else
+            {
+                _filter_list->tag = "\0";
+            }
 
             //json_object_put(fileter_listjson);
             _filter_list->next = (struct filter_list_t*)malloc(sizeof(struct filter_list_t));
@@ -216,6 +221,7 @@
         return -2;
 }
 
+
 int main(int argc, char* argv[])
 {
     log_config_entry listdata[5];