diff --git a/ap/app/ccapp/libzte_log.c b/ap/app/ccapp/libzte_log.c
new file mode 100755
index 0000000..f4ee383
--- /dev/null
+++ b/ap/app/ccapp/libzte_log.c
@@ -0,0 +1,170 @@
+/*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
+  LINUX ZTE LOG MODULE
+
+  GENERAL DESCRIPTION
+  print the log to the log file
+ *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
+
+ /*===========================================================================
+  INCLUDES
+  ===========================================================================*/
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <time.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <unistd.h> 
+
+#include "libzte_log.h"
+
+#include "softap_api.h"
+/*===========================================================================
+  DATA
+  ===========================================================================*/
+char para_buf[MAX_PARA_BUF]= {0};
+char log_buf[MAX_LOG_BUF]= {0};
+static int log_switch = 0;
+const off_t log_max_size = 2 * 1024 * 1024;
+
+pthread_mutex_t A_SmsMutexForLog;
+static int iSymbol = -1;
+/*===========================================================================
+  FUNCTIONS
+  ===========================================================================*/
+void zte_msg_print(const char *source_file,const unsigned int line,const char *fmt,...)
+{
+    va_list arg = {0};
+
+    if(NULL == source_file || NULL == fmt)
+    {
+        return ;
+    }
+    va_start(arg,fmt);
+    vsprintf(para_buf,fmt,arg);
+    va_end(arg);
+
+    printf("%s in FILE :%s,LINE :%d\n",para_buf,source_file,line);
+}
+
+extern int slog(char *mod, int prio, const char *fmt, ...);
+
+extern char *get_local_date_time(void);
+void zte_log_append(const char *source_file,const unsigned int line,
+                    const char *log_file,const char *fmt,...)
+{
+    //printf("[ccapp]:");
+    //printf(fmt);
+   // printf("\n");
+    //slog("[ccapp]", 4, fmt);
+
+//if(access("/usr/ccapp_log_printf", F_OK)>=0)
+{
+	va_list arg = {0};
+	char log_buf[1024]= {0};
+
+	if(NULL == source_file || NULL == fmt)
+	{
+		return ;
+	}
+	va_start(arg,fmt);
+	vsprintf(log_buf,fmt,arg);
+	va_end(arg);
+
+	printf("%s %s %d %s\n",get_local_date_time(),source_file,line,log_buf);
+	return;
+}
+#if 0
+else if(access("/usr/ccapp_log_file", F_OK)>=0)
+{
+    char nv_buf[NV_LOG_BUF_LEN]= {0};
+    char log_path[256]={0};
+    va_list arg;
+    int nv_status ;
+    int fd;
+    time_t clock;
+    char time_buf[64]={0};
+  
+	char log_path_old[300]={0};
+    struct stat statbuf;
+	
+	if(-1 == iSymbol)
+	{
+		pthread_mutex_init(&A_SmsMutexForLog, NULL);
+		iSymbol = 0;
+	}
+   
+	pthread_mutex_lock(&A_SmsMutexForLog);
+    
+#if 0
+    if(0 == access("/data/zte_apps_data/log_enable.flg",F_OK))
+    {
+        return;
+    }
+#endif
+    if(NULL == source_file || NULL == fmt || NULL == log_file)
+    {
+    	pthread_mutex_unlock(&A_SmsMutexForLog);
+        return ;
+    }
+    va_start(arg,fmt);
+    vsprintf(para_buf,fmt,arg);
+    va_end(arg);
+#if 0
+    sprintf(log_buf,"%s[` basename %s` %d H]   '%s' %s%s%s","echo ",\
+            source_file,line,para_buf,OP_APPEND,LOG_DIR_PATH,log_file);
+    soft_system(log_buf);
+#endif
+
+#if 1
+    time(&clock);
+    sprintf(time_buf, "%s", ctime(&clock));
+    //set the final \n to \0
+    time_buf[strlen(time_buf)-1] = 0;
+    sprintf(log_path, "%s%s", LOG_DIR_PATH, log_file);
+    sprintf(log_buf,"%s %s %d %s\n", time_buf, source_file, line, para_buf);
+	
+	if(0 == access(log_path, 0))
+	{
+		if (0 == stat(log_path, &statbuf)) {//cov m
+			if(statbuf.st_size > log_max_size)
+			{
+				sprintf(log_path_old, "%s%s_old", LOG_DIR_PATH, log_file);       
+				if (0 == remove(log_path_old)) {
+					if (rename(log_path, log_path_old) != 0) {//cov m
+						printf("rename zte_log_append err\n");
+					}
+				}
+			}
+		}
+	}
+	
+    if((fd=open(log_path, O_CREAT|O_WRONLY|O_APPEND, 0666))<0)//cov m
+    {
+        printf("can not open log: %s!\n", log_path);
+		pthread_mutex_unlock(&A_SmsMutexForLog);
+        return ;
+    }
+    write(fd, log_buf, strlen(log_buf));
+    close(fd);
+
+
+    
+#endif
+    //printf("%s\n",para_buf);
+	pthread_mutex_unlock(&A_SmsMutexForLog);
+    return ;
+}
+#endif
+}
+void zte_system_call(const char *fmt,...)
+{
+    va_list arg = {0};
+
+    va_start(arg,fmt);
+    vsprintf(para_buf,fmt,arg);
+    va_end(arg);
+    soft_system(para_buf);
+}
