improve zms logging
This commit is contained in:
parent
e617ffca2d
commit
752990bb0f
18
src/zms.cpp
18
src/zms.cpp
|
@ -84,12 +84,6 @@ int main( int argc, const char *argv[] ) {
|
|||
|
||||
zmLoadConfig();
|
||||
|
||||
logInit( "zms" );
|
||||
|
||||
hwcaps_detect();
|
||||
|
||||
zmSetDefaultTermHandler();
|
||||
zmSetDefaultDieHandler();
|
||||
|
||||
const char *query = getenv( "QUERY_STRING" );
|
||||
if ( query ) {
|
||||
|
@ -175,6 +169,14 @@ int main( int argc, const char *argv[] ) {
|
|||
} // end foreach parm
|
||||
} // end if query
|
||||
|
||||
char log_id_string[32] = "zms";
|
||||
if ( monitor_id ) {
|
||||
snprintf(log_id_string, sizeof(log_id_string), "zms_m%d", monitor_id);
|
||||
} else {
|
||||
snprintf(log_id_string, sizeof(log_id_string), "zms_e%d", event_id);
|
||||
}
|
||||
logInit( log_id_string );
|
||||
|
||||
if ( config.opt_use_auth ) {
|
||||
User *user = 0;
|
||||
|
||||
|
@ -205,6 +207,10 @@ int main( int argc, const char *argv[] ) {
|
|||
ValidateAccess( user, monitor_id );
|
||||
}
|
||||
|
||||
hwcaps_detect();
|
||||
zmSetDefaultTermHandler();
|
||||
zmSetDefaultDieHandler();
|
||||
|
||||
setbuf( stdout, 0 );
|
||||
if ( nph ) {
|
||||
fprintf( stdout, "HTTP/1.0 200 OK\r\n" );
|
||||
|
|
Loading…
Reference in New Issue