summaryrefslogtreecommitdiff
path: root/oslo_log
Commit message (Collapse)AuthorAgeFilesLines
* Make the eventlet logging fix execution conditional5.0.2Rodolfo Alonso Hernandez2022-11-141-2/+3
| | | | | | | | | | | | | | | | | | | 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]https://github.com/openstack/oslo.privsep/blob/1020c6fbf54f93cad9fa36b97bcd9cf75549984a/oslo_privsep/daemon.py#L579 [2]https://review.opendev.org/c/openstack/oslo.log/+/852443 Partial-Bug: #1995514 Related-Bug: #1995091 Change-Id: I4bbcfe7db6d75188e61b9084cb02b2dd2aaa0c76
* Fix logging in eventlet native threads5.0.1Gorka Eguileor2022-08-083-0/+368
| | | | | | | | | | | | | | | | | | | | | | 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]: https://opendev.org/openstack/swift/commit/69c715c505cf9e5df29dc1dff2fa1a4847471cb6 Closes-Bug: #1983863 Change-Id: Iac1b0891ae584ce4b95964e6cdc0ff2483a4e57d
* [Fix] init global_request_id if not in contextHervé Beraud2022-05-112-1/+13
| | | | | | | | 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
* Merge "Log Global Request IDs by default"4.8.0Zuul2022-04-261-2/+2
|\
| * Log Global Request IDs by defaultTakashi Kajinami2022-04-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add system scope information to default user identity stringTakashi Kajinami2022-04-192-6/+12
|/ | | | | | | | | | | | 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
* Add Zed in versionutilsGoutham Pacha Ravi2022-03-111-0/+2
| | | | | | | with these once could use versionutils.deprecated.ZED in config annotations and logs. Change-Id: I8d5ed01a4b4d1a544fe868c571a54dc96e8ae2f2
* Add Yoga to versionutils4.7.0Alan Bishop2022-02-051-0/+2
| | | | Change-Id: If1e846c79477cb0fc06d5702240e1dbb9f2c9c40
* Use project when logging the user identityAlan Bishop2022-02-052-27/+17
| | | | | | | | | | 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
* Replace deprecated arguments of RequestContext4.6.1Takashi Kajinami2021-07-231-4/+4
| | | | | | | | | | | | | | | | 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
* Merge "Remove references to 'sys.version_info'"4.6.0Zuul2021-06-011-5/+2
|\
| * Remove references to 'sys.version_info'Jorhson Deng2021-04-271-5/+2
| | | | | | | | | | | | We support Python 3.6 as a minimum now, making these checks no-ops. Change-Id: Ifd84fe4d7282e93998dc37cab4adda6d99d4adc1
* | Ussuri+ is python3 onlydengzhaosen2021-05-061-1/+1
|/ | | | | | update python to python3 Change-Id: I08e9b66e03c59af7f6600633aaa87d55fcd46a56
* Merge "Fix log_rotate_interval help text formatting"Zuul2021-04-161-1/+1
|\
| * Fix log_rotate_interval help text formattingEric Harney2021-04-151-1/+1
| | | | | | | | | | | | | | Add a missing space, this currently generates "setto" in config files. Change-Id: I4086fcab1e96e9127d7fe084d887cf57c8f87828
* | Merge "remove unicode from code"Zuul2021-04-161-5/+5
|\ \ | |/ |/|
| * remove unicode from codexuanyandong2021-01-031-5/+5
| | | | | | | | Change-Id: I4e4e6fc55053e9d524620022af442f1313a97446
* | Add Xena to versionutilsBen Nemec2021-01-191-0/+2
|/ | | | | | Adding warrior princess release to the list of releases. :-) Change-Id: I6bf6997899f6c95ed1074563164b82fce37f26f3
* Added uwsgi_name information into fluentFormatter event messageJan Vondra2020-07-111-0/+10
| | | | | | | | | | 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
* Add Victoria and Wallaby in versionutils.deprecated4.3.0Goutham Pacha Ravi2020-06-181-0/+2
| | | | | | | | with these once could use versionutils.deprecated.VICTORIA and versionutils.deprecated.WALLABY in config annotations and logs. Change-Id: I784dfe70c451958bf686f7d0e5ea9f5540bae08c
* Merge "Stop to use the __future__ module."4.2.1Zuul2020-06-031-2/+0
|\
| * Stop to use the __future__ module.Hervé Beraud2020-06-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: I2f3e6a91ec94f14d7a5cd65b1a32d55eb788c216
* | Default facility to None in OSJournalHandler classBrian Haley2020-06-012-1/+14
|/ | | | | | | | | | | | | | 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
* Add missing SYSLOG_FACILITY to JournalHandlerBenjamin Reichel2020-05-073-8/+22
| | | | | | | | | | | | 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
* Remove monotonic usageSean McGinnis2020-05-041-5/+1
| | | | | | | | | | 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>
* Imported Translations from ZanataOpenStack Proposal Bot2020-04-161-2/+6
| | | | | | | For more information about this automatic import see: https://docs.openstack.org/i18n/latest/reviewing-translation-import.html Change-Id: I6dbd3aaf4049b1dc2e3b6f58d64638525adad2fe
* Use unittest.mock instead of third party mock4.1.1Sean McGinnis2020-03-315-8/+11
| | | | | | | | 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>
* Merge "drop use of six"Zuul2020-03-219-152/+75
|\
| * drop use of sixHervé Beraud2020-03-129-152/+75
| | | | | | | | Change-Id: I0ad972f48ee6bc331b96aa67bd7e69c97fa8e2c3
* | Merge "Switch to hacking 2.x"4.1.0Zuul2020-03-093-12/+14
|\ \
| * | Switch to hacking 2.xCyril Roelandt2020-02-073-12/+14
| |/ | | | | | | Change-Id: I2c34c98ba6c927a0b1048e998ff50e063e94b481
* | Add Victoria and Wallaby releases to versionutilsBen Nemec2020-03-051-0/+2
|/ | | | | | | 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
* Drop use of unittest2Sean McGinnis2020-01-121-2/+3
| | | | | | | | | | | | 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>
* Always use jsonutils.to_primitive 'fallback' parameter3.45.2Stephen Finucane2019-12-102-23/+7
| | | | | | | | | 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>
* Serialize complex objects in FluentFormatter3.45.1Vladyslav Drok2019-12-091-10/+20
| | | | | | | | | | | 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
* Add Ussuri release to versionutilsBen Nemec2019-09-041-0/+2
| | | | | | Now that we have a name we can add it to the list. Change-Id: Icf10c2c8b1a5c90602dc0880f838bc9481e9b87e
* Use setLevel instead of setting logger.level directlyBen Nemec2019-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | Python 3.7 added caching of the log level for calls to isEnabledFor on a logger[0]. As a result, modifying the logger level directly can cause a mismatch in behavior if a log call was made prior to that modification. In our case, we were calling logger.info before the info level was enabled, which meant the logger cached the fact that it was not enabled for info-level logging. Even after setting the level to NOTSET, it was still remembering that it shouldn't log info messages and that breaks our unit tests on py37. There is a related issue open against Python[1], but basically the answer there was "don't mess with logger internals". The simple fix is to use logger.setLevel for resetting the log level instead of modifying the attribute directly. Change-Id: Ifd1300d8e4280df1913f632e964f9458dbb2db55 0: https://github.com/python/cpython/commit/78c18a9b9a1445f7c755929917a790ba02b4a5e0#diff-5bd69232a06838f179312d3e48ccf506 1: https://bugs.python.org/issue34269 Closes-Bug: 1783630
* Merge "Use raw string for regex"Zuul2019-05-041-1/+1
|\
| * Use raw string for regexSean McGinnis2019-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Special characters in regular strings now cause DeprecationWarnings starting with Python 3.6. This frequently happens with regex strings. Oslo.log had one instance of a regex string containing '\' that would cause deprecation warnings in logs. This switches that instance over to be a raw string to avoid these warnings. Change-Id: Ia5637f35315127c5cc46e01f5e38eccb094e772d Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | Merge "Add TRAIN to deprecated releases"Zuul2019-05-031-0/+2
|\ \
| * | Add TRAIN to deprecated releasesVishakha Agarwal2019-04-121-0/+2
| |/ | | | | | | | | | | | | | | | | Keystone uses versionutils for marking config settings as deprecated and currently TRAIN is missing as an option. This change adds the same. Change-Id: I0307665d468ac90b5208aadf6f85373bc339b44d
* | Added cmdline information into fluentFormatter event messageJan Vondra2019-03-281-0/+2
|/ | | | | | | | | Since process_name value defaults to "MainProcess" a new field cmdline has been added in order to get information which process (daemon) triggers the event. Change-Id: I1d7713ff7de930e40fc5b8ceb2cf2af54082c9cc Closes-Bug: 1822101
* Merge "Add 'levelkey' + 'tbkey' params"Zuul2019-03-042-7/+42
|\
| * Add 'levelkey' + 'tbkey' paramsAlexis Lee2019-01-302-7/+42
| | | | | | | | | | | | | | | | Currently the level and traceback must be present as keys 'levelname' and 'traceback'. Parameterising these will make the utility more broadly applicable. Change-Id: I80c9370081ef8229e8c37f0f86cb7d779e1526ec
* | Clarify some config options3.42.3Pavlo Shchelokovskyy2019-02-191-6/+11
|/ | | | | | | | | | | | | current help message to log-config-append is a bit misleading: if the extra logging config is using oslo_log's ContextFormatter as formatter for some handler, the logging_context_format_string option and the like do in fact still apply. Instead, give the `log-date-format` as example option that does apply when log-config-append is enabled and clarify that some options are used with ContextFormatter only. Change-Id: I917cdf8799ac0fb5b49873d5c7bccd957a42f347
* Merge "Fix handling of exc_info in OSJournalHandler"Zuul2018-12-192-7/+30
|\
| * Fix handling of exc_info in OSJournalHandlerNikita Gerasimov2018-11-302-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exc_info is exception tuple not intended to be printed. It's using to generate output by logging.Formatter().formatException() instead. exc_text used to cache this output. So we use handler formatter to get string from exc_info and send it as EXCEPTION_INFO. EXCEPTION_TEXT is kept for backward compatibility. Also adds type validation for journal.send fields to unit tests. Known types could be gotten from journal.DEFAULT_CONVERTERS. The rest payload must be either a string or bytes. Change-Id: Idc0b9edc61b4ec39dc9df0ea8282cc104e4d83c0 Closes-Bug: 1802142
* | Default oslo.policy logging to INFO3.42.1Matt Riedemann2018-12-101-0/+1
|/ | | | | | | | | | | As of change https://review.openstack.org/619260/ to oslo.policy a lot of information is logged at debug for every policy check, which gets to be a lot of information in something like the nova-api logs which does a policy check per API request. So this change makes the default log level INFO for oslo.policy. Change-Id: Ie4a114219a69390efd148b705fad05fd8b9a42de Related-Bug: #1807747
* Add config options for log rotation3.42.0Daniel Vincze2018-11-213-1/+114
| | | | | | | | | | | | | | | | | On Windows, in-use files cannot be moved or deleted. For this reason, we need the service itself to take care of rotating logs. For convenience reasons, we're exposing the built-in rotating log handlers through a set of config options. More specifically, we're adding the following new config options: - log_rotate_interval - log_rotate_interval_type - max_logfile_count - max_logfile_size_mb Change-Id: I01db4efc08e2cb64db9cbf793f3a159f54859fe7 Closes-Bug: #1802262
* Add Windows Event Log handlerDaniel Vincze2018-11-053-0/+30
| | | | | | | | The Python built-in logging module already provides a Windows Event Log handler. This change ensures that oslo.log exposes it. Change-Id: I287260b5046c88c433dfa66064da14faf15610e0 Implements: blueprint windows-event-log