https://bugs.openldap.org/show_bug.cgi?id=10140
Issue ID: 10140 Summary: Add microsecond timestamp format for local file logging Product: OpenLDAP Version: 2.6.6 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: gnoe@symas.com Target Milestone: ---
Add microsecond-level timestamps to local file logging.
Format is:
"YYYY-mm-ddTHH:MM:SS.ffffffZ"
The attached patch file is derived from OpenLDAP Software. All of the modifications to OpenLDAP Software represented in the following patch(es) were developed by Gregory Noe gnoe@symas.com. I have not assigned rights and/or interest in this work to any party.
The attached modifications to OpenLDAP Software are subject to the following notice:
Copyright 2023 Gregory Noe Redistribution and use in source and binary forms, with or without modification, are permitted only as authorized by the OpenLDAP Public License.
https://bugs.openldap.org/show_bug.cgi?id=10140
--- Comment #1 from gnoe@symas.com gnoe@symas.com --- Created attachment 994 --> https://bugs.openldap.org/attachment.cgi?id=994&action=edit Add microsecond timestamps to local file logging.
Updates logging.c, slapd-config.5 and slapd.conf.5
https://bugs.openldap.org/show_bug.cgi?id=10140
--- Comment #2 from Howard Chu hyc@openldap.org --- In the manpage, incorrect grammar:
s/include fractional/includes fractional/
In logging.c: Related symbols should all have the same prefix. RFC3339_UTC should be LFMT_RFC3339_UTC.
In this chunk - whitespace is misaligned. @@ -68,6 +70,10 @@ static char logpaths[2][MAXPATHLEN]; static int logpathlen;
#define SYSLOG_STAMP "Mmm dd hh:mm:ss" +#define RFC3339_STAMP "YYYY-mm-ddTHH:MM:SS.ffffffZ" +#define Tfrac_sz sizeof( "ffffffZ" ) +#define TS "%05x" +#define TSf "%06ldZ"
void slap_debug_print( const char *data )
In this chunk @@ -150,9 +155,18 @@ slap_debug_print( const char *data )
+ snprintf( strchr( ptr, '.' ) + 1, Tfrac_sz, TSf, Tfrac );
The format is constant width, you should be using ptr+[a constant] instead of strchr( ptr, '.' ) - you should already know where the '.' is.
This chunk @@ -162,8 +176,8 @@ slap_debug_print( const char *data )
Doesn't belong in the patch at all.
https://bugs.openldap.org/show_bug.cgi?id=10140
--- Comment #3 from Howard Chu hyc@openldap.org --- The changes to TS/Tfrac break nanosecond logging. That's not acceptable.
https://bugs.openldap.org/show_bug.cgi?id=10140
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs_review | Target Milestone|--- |2.7.0
https://bugs.openldap.org/show_bug.cgi?id=10140
gnoe@symas.com gnoe@symas.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #994 is|0 |1 obsolete| |
--- Comment #4 from gnoe@symas.com gnoe@symas.com --- Created attachment 1021 --> https://bugs.openldap.org/attachment.cgi?id=1021&action=edit Add microsecond timestamp format for local file logging [revised]
Patch revised.