Commit Graph

770 Commits

Author SHA1 Message Date
Tony Breeds 0d57be62d4 Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: I9fec1fbe4198abd8eba934b3162cee1aea128a1d
2017-09-12 16:06:09 -06:00
OpenStack Proposal Bot 8bb44cdedd Updated from global requirements
Change-Id: I329fe25a69ac2d18a5ea38b9ac4bed50c9466fac
2017-07-18 01:54:49 +00:00
Jenkins 3fd45abc67 Merge "Add log.get_loggers method" 2017-07-13 11:23:39 +00:00
ChangBo Guo(gcb) c7d0cb9288 Update URLs according to document migration
* Update setup.cfg/README.rst with right document links
* Update HACKING.rst with latest link for hacking

Change-Id: I0ff110b56fc86aa144d2ad67af5f0f09e75ad561
2017-07-11 22:46:53 +08:00
ChangBo Guo(gcb) b4fd0d1632 Add missing variable html_last_updated_fmt
It shows 'UPDATED: NONE' without setting variable html_last_updated_fmt

Change-Id: I43f63cd2ef3c3e33986ac064897faac3a387152a
2017-07-11 22:44:42 +08:00
OpenStack Proposal Bot 4e9d16d30b Updated from global requirements
Change-Id: I9944f280fcca7ff76cd5ebbb7f21516af6cc7c22
2017-07-05 13:19:42 +00:00
Jenkins ac074c4ec4 Merge "only show error_summary for warning and error messages" 2017-07-05 11:33:13 +00:00
Jenkins 276f0f153b Merge "Fix bug in log_method_call decorator" 2017-07-05 11:22:09 +00:00
Doug Hellmann 6e7b87c776 switch from oslosphinx to openstackdocstheme
Depends-On: Ifc5512c0e2373cf3387e0e0498268eab092e52bb
Change-Id: I890bc443bf07a4570c907668288176ff2411e4ed
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:18:33 -04:00
Doug Hellmann 0fd6b61d4f rearrange content to fit the new standard layout
Change-Id: Ic218b63c96d43c3c08744f18e0e0d56dd381987c
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:18:19 -04:00
Doug Hellmann 97e9a79fe2 only show error_summary for warning and error messages
Further reduce the clutter from error_summary by only including it when
the log message will be emitted for the warning level or above.

Change-Id: Ia46a7e569b875cd75fec652dfe8a4d73661dfda8
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-27 17:15:37 -04:00
OpenStack Proposal Bot 33d76a5d29 Updated from global requirements
Change-Id: I1fa74fa0f2188aa765210f1e455a7bfde0c84098
2017-06-27 12:20:11 +00:00
Gorka Eguileor 08b854f6b2 Add log.get_loggers method
In the Cinder project restarting the volume service is problematic
because it's not only in the control path but also in the data path of
some operations, so restarting it to change log levels is really
disruptive because it takes a long time to be done properly and it does
not support Active-Active configurations yet.

For this reason there's a specific API to change the log levels
dynamically based on a given prefix [1], but this feature is accessing
directly the `_loggers` dictionary which is not ideal.

This patch adds a simple method called `get_loggers` that will return a
copy of the internal `_loggers` dictionary so that the Cinder feature
can be changed to use this instead.

[1] https://review.openstack.org/445885

Change-Id: Ife33a5dd044a4565ad6a4d559ef9f0c108f260a3
2017-06-26 17:03:53 +02:00
OpenStack Proposal Bot 51889f4832 Updated from global requirements
Change-Id: I052c7f9df68be3e09e091ed4d937dce023cd6b95
2017-06-15 16:32:53 +00:00
Doug Hellmann 527a76e4e3 do not add error_summary for debug log messages
We catch exceptions and log debug messages a lot, which results in extra
occurrences of the exception when we don't need them.

Change-Id: I4dd3bf65fb456afc07a8fa7d0c9869bcc266b800
Related-Bug: #1696213
Related-Bug: #1696855
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-12 18:05:31 -04:00
Jenkins 34ecde5166 Merge "formatter: skip ImportError when adding error_summary" 2017-06-05 03:48:27 +00:00
OpenStack Proposal Bot 2f3c93dc37 Updated from global requirements
Change-Id: I39a505e5947d243d3821676fa16adf6411313884
2017-06-02 22:05:17 +00:00
Ihar Hrachyshka 14d2f88103 formatter: skip ImportError when adding error_summary
In some projects, we conditionally import modules that may be not
installed, for example in Neutron where we import from ibm_db_alembic
but ignore ImportError in alembic env.py.

It turned out that ImportError is not cleared by except: pass in py2
(but is correctly cleared in py3), as can be seen in the snippet below
(kudos to @dhellmann for providing it):

    apu:~$ cat testme.py
    import sys

    print('before:', sys.exc_info()[0])

    try:
        import nonesuch
    except ImportError:
        pass

    print('after:', sys.exc_info()[0])
    apu:~$ python2 ./testme.py
    ('before:', None)
    ('after:', <type 'exceptions.ImportError'>)
    apu:~$ python3 ./testme.py
    before: None
    after: None

The patch makes the formatter skip ImportErrors. We could in theory
limit it to py2 only but to simplify matters and to stick to identical
behavior across python runtimes, we will just unconditionally skip it
for all library consumers.

This is a follow up to Ifecb831c0adf4086a9d39feb3eb7e3865db780e6 ("skip
built-in exceptions when adding error_summary") that already skipped
some builtin exceptions.

Change-Id: Ia8f7e2501a49345b8d828ec3ee4a7cc870c8a0a8
2017-06-02 13:25:16 -07:00
OpenStack Proposal Bot 897144678e Updated from global requirements
Change-Id: I6d4cbefb369c15d2cfd3d3af44c6466c8736a702
2017-06-02 02:34:59 +00:00
OpenStack Proposal Bot a1b924d948 Updated from global requirements
Change-Id: Ie4369896e11557f34fafb08b8af4b8a5ea59a10b
2017-05-26 17:27:31 +00:00
Kiseok Kim 14a496ff91 Fix bug in log_method_call decorator
log_method_call decorator miss first argument of staticmethod and function.
the cause of bug is wrong start position of argument array for staticmethod.
This patch adds a bug fix and test code.

Change-Id: Id83378ba5954a855f18a4fdcfd22d2c7887991b2
Closes-Bug: #1672283
2017-05-25 14:43:02 +00:00
Doug Hellmann 76e8bb12fd clarify release note for error summary handling
Change-Id: I1513ab1e1f4e1abf1ad8e968ab47cf043a6f29a7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-24 16:34:37 -04:00
Jenkins dfef23d449 Merge "Updated from global requirements" 2017-05-24 04:44:14 +00:00
Doug Hellmann 3ecd5c9d3f fix test description comment
Update the comment to explain what the test does, rather than what the
old test that was copied to create the new test did.

Change-Id: I1a23d1134a3b0269bd2a61b8768a64fe6039fe85
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-24 01:55:18 +00:00
OpenStack Proposal Bot e568abd6ff Updated from global requirements
Change-Id: If61303cceaec8a336fa39b23cfae89582f11a61a
2017-05-24 00:52:37 +00:00
Jenkins bd86f2d6b1 Merge "add line number information to fluentd formatter" 2017-05-23 23:18:00 +00:00
Jenkins 22dde7b657 Merge "add error_summary support for fluentd formatter" 2017-05-23 19:37:02 +00:00
Jenkins 62e8c008eb Merge "add error_summary support to JSONFormatter" 2017-05-23 19:36:57 +00:00
Andrea Frittoli da55f6ff1f Oslo i18n 3.15.2 has broken deps
Oslo i18n removed babel from requirements but it has a runtime
dependency on it, so it fails to install.

g-r change: Ib77b3271a4e9861e391623ba5f03e5303512096a
Related-Bug: #1692773

Change-Id: I99afc304b2f0955a190ea5f298cdd1018bdf4ae4
2017-05-23 11:15:35 +01:00
Jenkins c418765722 Merge "refactor error summary logic so it can be reused" 2017-05-22 15:34:11 +00:00
ChangBo Guo(gcb) a7dbfa39fa Remove deprecated module loggers
The class WritableLogger was deprecated since liberty, and it's not
used by other projects, just remove it.

Depends-On: If8adae9807387fd32bad9923f5c7dab769572035
Depends-On: I1709f8a3f3ec50567b7f6217c3c1a2a61eecae62
Change-Id: I1ebed0855c5f9f410d8f6fbd786ce5b3409d8eb6
2017-05-22 01:54:51 +00:00
Jenkins b3665b70a6 Merge "improve the documentation for log format strings" 2017-05-21 16:10:28 +00:00
Jenkins 49422ab97f Merge "skip built-in exceptions when adding error_summary" 2017-05-21 16:07:31 +00:00
Jenkins 8252df5927 Merge "make handling of error_summary more flexible" 2017-05-21 16:05:44 +00:00
Jenkins e37f1550d7 Merge "add exception summaries to the main log line" 2017-05-21 16:05:38 +00:00
OpenStack Proposal Bot 39a974d476 Updated from global requirements
Change-Id: Ia49f626bb9ca16c4133519dd5c425a956ae4a447
2017-05-17 03:56:36 +00:00
Doug Hellmann 2663df215d add line number information to fluentd formatter
Change-Id: Idfb6dda0749b5dfdb2746de8db223d2df5e97abb
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:40:45 -04:00
Doug Hellmann 9ccd0dca1b add error_summary support for fluentd formatter
Change-Id: Ia4b570bd29783540b90dd36a5d189ee6940f8ea6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:31:45 -04:00
Doug Hellmann c06db3c1d1 add error_summary support to JSONFormatter
Change-Id: I177a9f1a127da8d7cbb4da5bccc315b5a7dbaaba
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:31:44 -04:00
Doug Hellmann b9f339eef2 refactor error summary logic so it can be reused
Change-Id: Ia5e55c035d087a27fa824f60a3a8aef19f6d485b
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:31:44 -04:00
Doug Hellmann 0defdcff96 improve the documentation for log format strings
Incorporate some of the information from the upstream docs here and add
information about a few of our custom message parameters.

Change-Id: Ib6f934e7f5d6e43afa8021241f92000c644c5e6d
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:31:43 -04:00
Doug Hellmann 0caffbd0db skip built-in exceptions when adding error_summary
We have a lot of cases where we catch a built-in exception then
log. Those exceptions don't add useful information, so do not include
them automatically in the log output.

Change-Id: Ifecb831c0adf4086a9d39feb3eb7e3865db780e6
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:18:49 -04:00
Doug Hellmann 426aae569f make handling of error_summary more flexible
Allow operators to override the location of the error summary within the
format string, if they choose.

Change-Id: I85fe5abaa0781d033638e3b6f120184726d205ac
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 16:17:57 -04:00
Doug Hellmann 48d284a985 add exception summaries to the main log line
Normally when logging while there is an active exception, the exception
is formatted as a traceback and the log message string ends up on a
separate line. This change adds the 1-line summary of the exception,
including the exception class name and the text of the exception, to the
end of the log line. The traceback is retained, so that the full details
are still logged.

Adding the exception info in the formatter means that the default
excepthook function no longer needs to do that (otherwise we end up with
duplicate information on the lines logged by the excepthook). Fix the
duplication by replacing the extra traceback formatting with a static
message that there is an unhandled error.

Depends-On: Icb2e1c6d9fe40229119467e9261055d9464d331d
Change-Id: Ib29883a1b7aa665b5d3c728dd7bd53d449987191
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-05-15 15:41:05 -04:00
OpenStack Proposal Bot 84341f6201 Updated from global requirements
Change-Id: Ib841b7da7458dd77eadda3228463fa9db98bb2ff
2017-05-15 00:52:53 +00:00
melanie witt 72e5c3c1e2 Use dict arg values for unicode checks in ContextFormatter
In ContextFormatter.format(), for python2 it checks each arg to
determine whether unicode should be used for the format message.
The problem is the code assumes the args are a list, when they can
also be a dict, for example:

  LOG.info('%(thing)s', {'thing': '...'})

and in that case, the dict keys were implicitly being used for the
checks. The checks will always pass on string dict keys, so the
format message gets converted to unicode even though the corresponding
args will ultimately fail decoding to unicode. Then, the logging fails
with:

  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc6 in
  position 0: ordinal not in range(128)

when the unicode format message causes an implicit conversion attempt
of the args to unicode [1].

This adds a check for the args type and uses the dict values for the
unicode checks so that dict args with values that fail decoding will
have: should_use_unicode = False.

Closes-Bug: #1580728

[1] https://github.com/python/cpython/blob/2e576f5/Lib/logging/__init__.py#L338

Change-Id: I8c479e507efcf8acd3e3faa4a702fa6e1f18772f
2017-05-04 20:59:10 +00:00
Jenkins ce484ec3ff Merge "Add oslo_messaging to the list of log levels" 2017-04-21 06:11:01 +00:00
Thomas Herve 0aabc905b5 Add oslo_messaging to the list of log levels
The namespace name (oslo.messaging) is set to INFO, but we don't do it
with the oslo_messaging package name. It logs with both prefix, so we
should set INFO on both.

Change-Id: Ia8e53b0b40dd546abecc73abe855939200167ee8
2017-04-19 21:54:51 +00:00
Monty Taylor a5ee482cee
Add additional info like python-systemd does
Upstream python-systemd has a journald logging handler that also adds
some exception information, as well as thread information.

  https://github.com/systemd/python-systemd/blob/master/systemd/journal.py#L581-L589

While OpenStack doesn't use a lot of threads, we might as well support it
since it's no cost. Also, add PROCESS_NAME just to be compatible with
other programs that might use python journald logging. Not entirely sure
if record.processName and the results of our self.binary_name will be
different.

The exception info is the fun stuff though.

Change-Id: Ibf0d7dae7587639737e0327f0338f30cdfc6aba1
2017-04-19 09:44:19 -05:00
Jenkins 8593e2e8b7 Merge "Fix syslog module usage breaking Windows compatibility" 2017-04-13 17:44:26 +00:00