ol-openedx-logging 0.0.1__tar.gz

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.
@@ -0,0 +1 @@
1
+ include *.py
@@ -0,0 +1,6 @@
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
File without changes
@@ -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))
@@ -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
+ }
@@ -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,6 @@
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
@@ -0,0 +1,15 @@
1
+ MANIFEST.in
2
+ __init__.py
3
+ backend_shim.py
4
+ setup.py
5
+ ol_openedx_logging/__init__.py
6
+ ol_openedx_logging/app.py
7
+ ol_openedx_logging.egg-info/PKG-INFO
8
+ ol_openedx_logging.egg-info/SOURCES.txt
9
+ ol_openedx_logging.egg-info/dependency_links.txt
10
+ ol_openedx_logging.egg-info/entry_points.txt
11
+ ol_openedx_logging.egg-info/namespace_packages.txt
12
+ ol_openedx_logging.egg-info/requires.txt
13
+ ol_openedx_logging.egg-info/top_level.txt
14
+ ol_openedx_logging/settings/__init__.py
15
+ ol_openedx_logging/settings/production.py
@@ -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
+ Django>2.0
2
+ python-json-logger<3.0.0,>=2.0.2
@@ -0,0 +1,2 @@
1
+
2
+ ol_openedx_logging
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,34 @@
1
+
2
+ # DO NOT EDIT THIS FILE -- AUTOGENERATED BY PANTS
3
+ # Target: src/ol_openedx_logging:logging_package
4
+
5
+ from setuptools import setup
6
+
7
+ setup(**{
8
+ 'description': 'An Open edX plugin to customize the logging configuration used by the edx-platform application',
9
+ 'entry_points': {
10
+ 'lms.djangoapp': [
11
+ 'ol_openedx_logging = ol_openedx_logging.app:EdxLoggingLMS',
12
+ ],
13
+ 'cms.djangoapp': [
14
+ 'ol_openedx_logging = ol_openedx_logging.app:EdxLoggingCMS',
15
+ ],
16
+ },
17
+ 'install_requires': (
18
+ 'Django>2.0',
19
+ 'python-json-logger<3.0.0,>=2.0.2',
20
+ ),
21
+ 'license': 'BSD-3-Clause',
22
+ 'name': 'ol-openedx-logging',
23
+ 'namespace_packages': (
24
+ ),
25
+ 'package_data': {
26
+ },
27
+ 'packages': (
28
+ '',
29
+ 'ol_openedx_logging',
30
+ 'ol_openedx_logging.settings',
31
+ ),
32
+ 'python_requires': '>=3.8',
33
+ 'version': '0.0.1',
34
+ })