diff --git a/log_manager/log_manager.cc b/log_manager/log_manager.cc index 27c026763..fd34aa73b 100644 --- a/log_manager/log_manager.cc +++ b/log_manager/log_manager.cc @@ -57,8 +57,9 @@ const char* shm_pathname = "/dev/shm"; /** Logfile ids from call argument '-s' */ -char* shmem_id_str = NULL; -char* syslog_id_str = NULL; +char* shmem_id_str = NULL; +char* syslog_id_str = NULL; +char* syslog_ident_str = NULL; /** * Global log manager pointer and lock variable. * lmlock protects logmanager access. @@ -1350,6 +1351,7 @@ static bool fnames_conf_init( "-i ............(\".log\")\n" "-j ............(\"/tmp\")\n" "-l .......(no default)\n" + "-m ............(argv[0])\n" "-s .......(no default)\n"; /** @@ -1360,7 +1362,8 @@ static bool fnames_conf_init( fn->fn_chk_top = CHK_NUM_FNAMES; fn->fn_chk_tail = CHK_NUM_FNAMES; #endif - while ((opt = getopt(argc, argv, "+a:b:c:d:e:f:g:h:i:j:l:s:")) != -1) { + while ((opt = getopt(argc, argv, "+a:b:c:d:e:f:g:h:i:j:l:m:s:")) != -1) + { switch (opt) { case 'a': fn->fn_debug_prefix = strndup(optarg, MAX_PREFIXLEN); @@ -1401,6 +1404,14 @@ static bool fnames_conf_init( /** record list of log file ids for syslogged */ syslog_id_str = optarg; break; + + case 'm': + /** + * Identity string for syslog printing, needs '-l' + * to be effective. + */ + syslog_ident_str = optarg; + break; case 's': /** record list of log file ids for later use */ @@ -1434,6 +1445,10 @@ static bool fnames_conf_init( fn->fn_logpath = (fn->fn_logpath == NULL) ? strdup(get_logpath_default()) : fn->fn_logpath; + /** Set identity string for syslog if it is not set in config.*/ + syslog_ident_str = (syslog_ident_str == NULL) ? + syslog_ident_str = strdup(*argv) : syslog_ident_str; + /* ss_dfprintf(stderr, "\n\n\tCommand line : "); for (i=0; i