diff --git a/service-mgmt/sm-common/src/sm_debug.c b/service-mgmt/sm-common/src/sm_debug.c index 2da492bd..1ac66b28 100644 --- a/service-mgmt/sm-common/src/sm_debug.c +++ b/service-mgmt/sm-common/src/sm_debug.c @@ -28,7 +28,7 @@ typedef struct { bool inuse; uint64_t log_seqnum; - u_int64_t service_log_seqnum; + uint64_t service_log_seqnum; char thread_name[SM_THREAD_NAME_MAX_CHAR]; int thread_id; char thread_identifier[SM_THREAD_NAME_MAX_CHAR+10]; diff --git a/service-mgmt/sm-common/src/sm_debug_thread.c b/service-mgmt/sm-common/src/sm_debug_thread.c index 629f41f3..cb0638c0 100644 --- a/service-mgmt/sm-common/src/sm_debug_thread.c +++ b/service-mgmt/sm-common/src/sm_debug_thread.c @@ -31,12 +31,6 @@ #define SM_SYSLOG( format, args... ) \ syslog( LOG_LOCAL3 | LOG_DEBUG, format "\n", ##args ) -#define SM_WRITE_SYSLOG( format, args... ) \ - syslog( LOG_LOCAL3 | LOG_DEBUG, format "\n", ##args ) - -#define SM_WRITE_SERVICELOG( format, args... ) \ - syslog( LOG_LOCAL0 | LOG_DEBUG, format "\n", ##args ) - #define SM_WRITE_SCHEDLOG( format, args... ) \ fprintf( _sched_log, format "\n", ##args ); \ fflush( _sched_log ) @@ -89,8 +83,8 @@ static void sm_debug_thread_dispatch( int selobj, int64_t user_data ) sm_time_get( &time_prev ); - SM_WRITE_SYSLOG( "time[%ld.%03ld] log<%" PRIu64 "> %s", - (long) msg.u.log.ts_mono.tv_sec, + SM_SYSLOG( "time[%ld.%03ld] log<%" PRIu64 "> %s", + (long) msg.u.log.ts_mono.tv_sec, (long) msg.u.log.ts_mono.tv_nsec/1000000, msg.u.log.seqnum, msg.u.log.data ); @@ -132,7 +126,7 @@ static void sm_debug_thread_dispatch( int selobj, int64_t user_data ) sm_time_get( &time_prev ); - SM_WRITE_SERVICELOG( "time[%ld.%03ld] log<%" PRIu64 "> %s", + SM_SYSLOG( "time[%ld.%03ld] sm_svc_log<%" PRIu64 "> %s", (long) msg.u.log.ts_mono.tv_sec, (long) msg.u.log.ts_mono.tv_nsec/1000000, msg.u.log.seqnum, msg.u.log.data ); diff --git a/service-mgmt/sm/src/scripts/sm.syslog b/service-mgmt/sm/src/scripts/sm.syslog index 4191c514..a5b669c8 100644 --- a/service-mgmt/sm/src/scripts/sm.syslog +++ b/service-mgmt/sm/src/scripts/sm.syslog @@ -1,9 +1,11 @@ #SM log filters -filter f_smsvc { facility(local0) and program(sm); }; +filter f_smsvc { facility(local3) and match("sm_svc_log.*"); }; +filter f_local3 { facility(local3) and not filter(f_smsvc); }; #SM log destinaions destination d_smsvc { file("/var/log/sm-service.log"); }; +destination d_sm { file("/var/log/sm.log"); }; #SM log paths log { source(s_src); filter(f_smsvc); destination(d_smsvc); }; - +log { source(s_src); filter(f_local3); destination(d_sm); };