#50381 Issue 49029 - [RFE] improve internal operations logging
Closed by spichugi. Opened by bsmejkal.
bsmejkal/389-ds-base improve_internal_logging  into  master

Download 50381.patch

Description:
Edited the test cases by changing the 'op' number to regex, because the values were hardcoded into the test and if there was some more fixing of internal logs that would cause the 'op' number to raise up/lower down then the test would fail. The main goal is to check syntax of internal messages, not to match 'op' numbers.

https://pagure.io/389-ds-base/issue/49029

Reviewed by: ???

:thumbsup:
Tests pass on RHEL8/Fedora30

Actually, one more thing:

tests/suites/ds_logs/ds_logs_test.py::test_check_default
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:49: DeprecationWarning: invalid escape sequence \[
    self.prog_timestamp = re.compile('\[(?P<day>\d*)\/(?P<month>\w*)\/(?P<year>\d*):(?P<hour>\d*):(?P<minute>\d*):(?P<second>\d*)(.(?P<nanosecond>\d*))+\s(?P<tz>[\+\-]\d*)')   # noqa
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:50: DeprecationWarning: invalid escape sequence \[
    self.prog_datetime = re.compile('^(?P<timestamp>\[.*\])')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:183: DeprecationWarning: invalid escape sequence \[
    self.prog_m1 = re.compile('^(?P<timestamp>\[.*\])\sconn=(?P<conn>\d*)\sop=(?P<op>\d*)\s(?P<action>\w*)\s(?P<rem>.*)')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:184: DeprecationWarning: invalid escape sequence \[
    self.prog_con = re.compile('^(?P<timestamp>\[.*\])\sconn=(?P<conn>\d*)\sfd=(?P<fd>\d*)\sslot=(?P<slot>\d*)\sconnection\sfrom\s(?P<remote>[^\s]*)\sto\s(?P<local>[^\s]*)')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:185: DeprecationWarning: invalid escape sequence \[
    self.prog_discon = re.compile('^(?P<timestamp>\[.*\])\sconn=(?P<conn>\d*)\sop=(?P<op>\d*)\sfd=(?P<fd>\d*)\s(?P<action>closed)\s-\s(?P<status>\w*)')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:187: DeprecationWarning: invalid escape sequence \d
    self.prog_notes = re.compile('err=(?P<err>\d*)\stag=(?P<tag>\d*)\snentries=(?P<nentries>\d*)\setime=(?P<etime>[0-9.]*)\snotes=(?P<notes>\w*)')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:188: DeprecationWarning: invalid escape sequence \d
    self.prog_repl = re.compile('err=(?P<err>\d*)\stag=(?P<tag>\d*)\snentries=(?P<nentries>\d*)\setime=(?P<etime>[0-9.]*)\scsn=(?P<csn>\w*)')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:189: DeprecationWarning: invalid escape sequence \d
    self.prog_result = re.compile('err=(?P<err>\d*)\stag=(?P<tag>\d*)\snentries=(?P<nentries>\d*)\setime=(?P<etime>[0-9.]*)\s(?P<rem>.*)')
  /workspace/ds/src/lib389/lib389/dirsrv_log.py:249: DeprecationWarning: invalid escape sequence \[
    self.prog_m1 = re.compile('^(?P<timestamp>\[.*\])\s(?P<message>.*)')

These strings need to be raw strings r'...'.

@vashirov
Thanks.
Sure, will fix.

rebased onto 695cce8e4902e802ef7c40a22cca748009d8a4c9

@vashirov
Rebased, please check.

Looks good, thanks! Please rebase it and we can merge it.

rebased onto cd000871ac580308655a0ac21a3c0acf9ac6c512

Pull-Request has been merged by vashirov

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3308

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata