... and raise an exception when the feature is explicitly requested.
The feature has been broken for some time, and depends on pyinotify
library which has been unmaintained for long time and is not compatible
with python 3.12 (because it uses asyncore).
Related-Bug: #1740111
Closes-Bug: #2059855
Change-Id: I209b1260ed4de64cbfc561a1da81a66f7a5ea397
This feature has been broken for some time without any actual update
to fix it. Also the pyinotify package used hasn't been updated for 9
years and looks badly unmaintained.
Related-Bug: #1740111
Related-Bug: #2059855
Change-Id: If776fee0072d95737e1c19ad673a3c881a89de06
The get_logging_values method was added in oslo.context 2.0.0[1].
[1] 22ad2c2c591f16012a75c99bd11b2f30d35bffff
Closes-Bug: #1715148
Change-Id: Idb31334674805e821cf5c34b9553b7002d158b6c
Eventlet may be installed, but not used for example projects
like octavia. Improve autodetection mechanism by trying to import
module and check if it is actually patched.
Closes-Bug: #2039346
Change-Id: I860abe953ce945bb5152c77a7daeb6aa1003512b
Since python 3.12, logging is raising RuntimeError when content is
invalid [1][2]. Note this is also backported to 3.11 branch.
This is making oslo_log to not raise LogConfigError but throw the
underlying RuntimeError.
[1] 152227b569
[2] 12f1581b0c
Change-Id: I7631394bee7281f6a393ab4ba7604f871626997a
This patch changes the ``log.setup()`` signature to allow a kwarg
that makes the eventlet logging fix conditional.
Some libraries that import oslo.log, replace the logging locking
handling with its own implementation. For example oslo.privsep
replaces the logging handler with its own one [1], that allows the
communication between the privileged daemon process and the service
importing the library. This local handler clashes with the
evenlet logging fix implemented in [2].
[1]1020c6fbf5/oslo_privsep/daemon.py (L579)
[2]https://review.opendev.org/c/openstack/oslo.log/+/852443
Partial-Bug: #1995514
Related-Bug: #1995091
Change-Id: I4bbcfe7db6d75188e61b9084cb02b2dd2aaa0c76
There is a bug in eventlet where logging within a native thread can lead
to a deadlock situation: https://github.com/eventlet/eventlet/issues/432
When encountered with this issue some projects in OpenStack using
oslo.log, eg. Cinder, resolve them by removing any logging withing
native threads.
There is actually a better approach. The Swift team came up with a
solution a long time ago [1], and in this patch that fix is included as
part of the setup method, but will only be run if the eventlet library
has already been loaded.
This patch adds the eventlet library as a testing dependency for the
PipeMutext unit tests.
[1]: 69c715c505
Closes-Bug: #1983863
Change-Id: Iac1b0891ae584ce4b95964e6cdc0ff2483a4e57d
Initialize by default the `global_request_id` if not passed
in the given context to avoid error with logging.
Change-Id: I6bd63c1d6a1331a4e47b923ccf6df50c930c8162
Closes-Bug: #1972974
Global Request IDs were introduced a while ago[1] so that operators can
trace processing of resources across multiple services more easily.
Some services like Nova or Neutron have implemented this feature and
a request made by these services have additional global request id in
its context. However current default format doesn't include that new id
and users need to update the log format parameter in each service to
get this information recorded.
This change updates the default log format so that the Global Request
IDs can be more widely and easily used.
[1] https://specs.openstack.org/openstack/oslo-specs/specs/pike/global-req-id.html
Change-Id: I1adc9b29bb356ce56704c066b375b49374200d3c
As part of Secure RBAC work, support for system users(eg. system admin)
is being added. However current default format does not include
the system scope information so we can't determine whether the context
is non-scoped or system-scoped.
This change updates the default logging_user_identity_format so that
system scope is logged by default.
Change-Id: I7982cdb280599fb38362eb837cb527592267b91f
The logging_user_identity_format option's default value is changed
to reference the project instead of the tenant. This is necessary
because I2fded6f3476df1fb8c4e042ef28ed8ccb7ab0737 removed the tenant
argument from request contexts.
Related-Bug: #1505827
Change-Id: Id6d4b6eaa2b96ba5bd53e8b2dae5d9eea13b25d9
The following arguments of the RequestContext class are deprecated
since oslo.context 2.18[1].
user : renamed to user_id
tenant : renamed to project_id
domain : renamed to domain_id
user_domain : renamed to user_domain_id
project_domain: renamed to project_domain_id
This change updates arguments used accordingly.
[1] d78cf592e1e3e7aa0fc99bfdd655e82f5c44dfe3
Change-Id: I815790106e42ca3cb5b8b3cf98b065a27b9a520e
When running under uwsgi a new key "uwsgi_name" is added to log
events when using FluentFormatter that could be used for further
analysis. It's value is taken from uwsgi configuration upon
formatter initialization.
Change-Id: I158409677523978246c26bf1168f323974d817a5
Closes-Bug: 1887232
with these once could use versionutils.deprecated.VICTORIA
and versionutils.deprecated.WALLABY in config annotations
and logs.
Change-Id: I784dfe70c451958bf686f7d0e5ea9f5540bae08c
Use a default value of None for facility in OSJournalHandler
class, as is done in the OSSysLogHandler class.
Neutron started failing with a:
E1120: No value for argument 'facility' in constructor call
With a recent release of oslo.log.
Change-Id: I5269b82d219fd2377535120d9d266238d50431b3
Related-Bug: #1871840
Without SYSLOG_FACILITY log messages from journald forwards the message
to kern.log. This seems to be default behaviour as it treats the message
as kernel message.
This option provides a proper facility to the log message and kern.log
will not be filled up anymore.
Change-Id: I62a32ed46a400b62ead8c1e6e64acee658e2a769
Closes-Bug: #1871840
The monotonic package was needed for monotonic time operations when
running under Python runtimes older than 3.3. Since we now only support
versions higher than this, this third party package requirement can now
be removed.
Change-Id: Id250b92d11aeb6fa02e264610bfe8e8c71df7e26
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I5587ac8f603798aad27908d3bd6ed8ebb3a9c14e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Now that we have names for the next two releases we can get them
added here so we'll be ready when development starts.
Change-Id: I515a6b03b810a7c8b2246279e380973a29c626f4
unittest2 was needed for Python version <= 2.6, so it has not been
needed for quite some time now. See unittest2 note on:
https://docs.python.org/2.7/library/unittest.html
This replaces unittest2 in favor of the standard unittest package.
Change-Id: Idd5df4c8068810bbbd2bd5058ca38df9f5416a62
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This was optionally being enabled to handle the case where we did not
have oslo.serialization 2.21.1. Our minimum version is now 2.25.0 so
this will never be the case. Remove this optionality logic.
Change-Id: Ib61e1fd02a5ec98ddcaed2ce42f049636598870f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This change introduces the serialization with basically json dumps,
falling back to repr for non-serializable object. We check the types
of the top level objects passed to the formatter, as for example
an object enclosed into dictionary passed to the logger should be a
much more rare case.
Closes-Bug: 1782361
Change-Id: Ib214f95abfadd91f85b6cce853057a572ec287f6