ol-openedx-logging 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
__init__.py ADDED
File without changes
backend_shim.py ADDED
@@ -0,0 +1,24 @@
1
+
2
+ # DO NOT EDIT THIS FILE -- AUTOGENERATED BY PANTS
3
+
4
+ import os
5
+ import setuptools.build_meta
6
+
7
+ backend = setuptools.build_meta.__legacy__
8
+
9
+ dist_dir = "dist"
10
+ build_wheel = True
11
+ build_sdist = True
12
+ wheel_config_settings = {
13
+ }
14
+ sdist_config_settings = {
15
+ }
16
+
17
+ os.makedirs(dist_dir, exist_ok=True)
18
+ wheel_path = backend.build_wheel(dist_dir, wheel_config_settings) if build_wheel else None
19
+ sdist_path = backend.build_sdist(dist_dir, sdist_config_settings) if build_sdist else None
20
+
21
+ if wheel_path:
22
+ print("wheel: {wheel_path}".format(wheel_path=wheel_path))
23
+ if sdist_path:
24
+ print("sdist: {sdist_path}".format(sdist_path=sdist_path))
File without changes
@@ -0,0 +1,21 @@
1
+ from django.apps import AppConfig
2
+
3
+
4
+ class EdxLoggingLMS(AppConfig):
5
+ name = "ol_openedx_logging"
6
+ verbose_name = "Log customization support for Open edX platform"
7
+ plugin_app = {
8
+ "settings_config": {
9
+ "lms.djangoapp": {"production": {"relative_path": "settings.production"}}
10
+ }
11
+ }
12
+
13
+
14
+ class EdxLoggingCMS(AppConfig):
15
+ name = "ol_openedx_logging"
16
+ verbose_name = "Log customization support for Open edX platform"
17
+ plugin_app = {
18
+ "settings_config": {
19
+ "cms.djangoapp": {"production": {"relative_path": "settings.production"}}
20
+ }
21
+ }
File without changes
@@ -0,0 +1,88 @@
1
+ from typing import Any, Dict
2
+ import platform
3
+ import sys
4
+
5
+
6
+ def _load_env_tokens(edx_settings, default_settings: Dict[str, Any]) -> Dict[str, Any]:
7
+ configured_tokens = getattr(edx_settings, "ENV_TOKENS", {})
8
+ default_settings.update(configured_tokens)
9
+ return default_settings
10
+
11
+
12
+ def plugin_settings(edx_settings):
13
+ # Taken directly from Tutor from overhang.io
14
+
15
+ # This file and other files adapted from Tutor are covered by
16
+ # and subject to the AGPL-3 as a clause 5 'aggregate'.
17
+ hostname = platform.node().split(".")[0]
18
+ syslog_format = (
19
+ "[service_variant={service_variant}]"
20
+ "[%(name)s][env:{logging_env}] %(levelname)s "
21
+ "[{hostname} %(process)d] [%(filename)s:%(lineno)d] "
22
+ "- %(message)s"
23
+ ).format(
24
+ service_variant=edx_settings.SERVICE_VARIANT,
25
+ logging_env=edx_settings.LOGGING_ENV,
26
+ hostname=hostname,
27
+ )
28
+
29
+ handlers = ["console"]
30
+
31
+ logger_config = {
32
+ "version": 1,
33
+ "disable_existing_loggers": False,
34
+ "formatters": {
35
+ "standard": {
36
+ "format": "%(asctime)s %(levelname)s %(process)d "
37
+ "[%(name)s] %(filename)s:%(lineno)d - %(message)s",
38
+ },
39
+ "syslog_format": {"format": syslog_format},
40
+ "raw": {"format": "%(message)s"},
41
+ },
42
+ "filters": {
43
+ "require_debug_false": {
44
+ "()": "django.utils.log.RequireDebugFalse",
45
+ },
46
+ "userid_context": {
47
+ "()": "edx_django_utils.logging.UserIdFilter",
48
+ },
49
+ "remoteip_context": {
50
+ "()": "edx_django_utils.logging.RemoteIpFilter",
51
+ },
52
+ },
53
+ "handlers": {
54
+ "console": {
55
+ "level": "INFO",
56
+ "class": "logging.StreamHandler",
57
+ "formatter": "standard",
58
+ "filters": ["userid_context", "remoteip_context"],
59
+ "stream": sys.stderr,
60
+ },
61
+ "tracking": {
62
+ "level": "DEBUG",
63
+ "class": "logging.handlers.RotatingFileHandler",
64
+ "filename": "/openedx/data/var/logs/tracking_logs.log",
65
+ "backupCount": 5,
66
+ "formatter": "raw",
67
+ "maxBytes": 10485760,
68
+ },
69
+ },
70
+ "loggers": {
71
+ "django": {"handlers": handlers, "propagate": True, "level": "INFO"},
72
+ "tracking": {
73
+ "handlers": ["tracking"],
74
+ "level": "DEBUG",
75
+ "propagate": False,
76
+ },
77
+ "requests": {"handlers": handlers, "propagate": True, "level": "WARNING"},
78
+ "factory": {"handlers": handlers, "propagate": True, "level": "WARNING"},
79
+ "django.request": {
80
+ "handlers": handlers,
81
+ "propagate": True,
82
+ "level": "ERROR",
83
+ },
84
+ "": {"handlers": handlers, "level": "INFO", "propagate": False},
85
+ },
86
+ }
87
+
88
+ edx_settings.LOGGING = logger_config
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.1
2
+ Name: ol-openedx-logging
3
+ Version: 0.0.1
4
+ Summary: An Open edX plugin to customize the logging configuration used by the edx-platform application
5
+ License: BSD-3-Clause
6
+ Requires-Python: >=3.8
7
+ Requires-Dist: Django (>2.0)
8
+ Requires-Dist: python-json-logger (<3.0.0,>=2.0.2)
9
+
@@ -0,0 +1,12 @@
1
+ __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ backend_shim.py,sha256=ftcEJ8ZHQyDKQNKCBoPbg-uZLYBu4nI6JZWUBLemhRc,625
3
+ ol_openedx_logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ ol_openedx_logging/app.py,sha256=sjnzflTe1mULEN4sbBQgUqqkbVN9AMyQ4-WlXI97w4U,604
5
+ ol_openedx_logging/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ ol_openedx_logging/settings/production.py,sha256=0O2ziktHaqpsOEFjof99SowY_987znfDmUmMRcEr7wk,3037
7
+ ol_openedx_logging-0.0.1.dist-info/METADATA,sha256=RLsP4Ono72xZeesqhfJL4w0k75fvMC35poKeupVV09A,292
8
+ ol_openedx_logging-0.0.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
9
+ ol_openedx_logging-0.0.1.dist-info/entry_points.txt,sha256=ZM2KwehRjCAcYjgSEthEPCct4W5_pJGL0udv0ryHroc,149
10
+ ol_openedx_logging-0.0.1.dist-info/namespace_packages.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
11
+ ol_openedx_logging-0.0.1.dist-info/top_level.txt,sha256=zEdP9GgRieWV26R1bBMkaVAmsTwNh4dFV2j9kcAEjz8,20
12
+ ol_openedx_logging-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.37.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,5 @@
1
+ [cms.djangoapp]
2
+ ol_openedx_logging = ol_openedx_logging.app:EdxLoggingCMS
3
+
4
+ [lms.djangoapp]
5
+ ol_openedx_logging = ol_openedx_logging.app:EdxLoggingLMS
@@ -0,0 +1,2 @@
1
+
2
+ ol_openedx_logging