Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
cef089f7
Commit
cef089f7
authored
Aug 31, 2012
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tracking log filename now determined by puppet, formatting cleanup
parent
4c8ff641
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
59 deletions
+64
-59
lms/envs/dev.py
+7
-0
lms/envs/logsettings.py
+57
-59
No files found.
lms/envs/dev.py
View file @
cef089f7
...
@@ -13,6 +13,7 @@ from .logsettings import get_logger_config
...
@@ -13,6 +13,7 @@ from .logsettings import get_logger_config
DEBUG
=
True
DEBUG
=
True
TEMPLATE_DEBUG
=
True
TEMPLATE_DEBUG
=
True
MITX_FEATURES
[
'DISABLE_START_DATES'
]
=
True
MITX_FEATURES
[
'DISABLE_START_DATES'
]
=
True
MITX_FEATURES
[
'ENABLE_SQL_TRACKING_LOGS'
]
=
True
MITX_FEATURES
[
'ENABLE_SQL_TRACKING_LOGS'
]
=
True
MITX_FEATURES
[
'SUBDOMAIN_COURSE_LISTINGS'
]
=
False
# Enable to test subdomains--otherwise, want all courses to show up
MITX_FEATURES
[
'SUBDOMAIN_COURSE_LISTINGS'
]
=
False
# Enable to test subdomains--otherwise, want all courses to show up
...
@@ -55,6 +56,7 @@ CACHES = {
...
@@ -55,6 +56,7 @@ CACHES = {
}
}
}
}
XQUEUE_INTERFACE
=
{
XQUEUE_INTERFACE
=
{
"url"
:
"https://sandbox-xqueue.edx.org"
,
"url"
:
"https://sandbox-xqueue.edx.org"
,
"django_auth"
:
{
"django_auth"
:
{
...
@@ -70,6 +72,7 @@ CACHE_TIMEOUT = 0
...
@@ -70,6 +72,7 @@ CACHE_TIMEOUT = 0
# Dummy secret key for dev
# Dummy secret key for dev
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
COURSE_LISTINGS
=
{
COURSE_LISTINGS
=
{
'default'
:
[
'BerkeleyX/CS169.1x/2012_Fall'
,
'default'
:
[
'BerkeleyX/CS169.1x/2012_Fall'
,
'BerkeleyX/CS188.1x/2012_Fall'
,
'BerkeleyX/CS188.1x/2012_Fall'
,
...
@@ -85,6 +88,7 @@ COURSE_LISTINGS = {
...
@@ -85,6 +88,7 @@ COURSE_LISTINGS = {
'sjsu'
:
[
'MITx/6.002x-EE98/2012_Fall_SJSU'
],
'sjsu'
:
[
'MITx/6.002x-EE98/2012_Fall_SJSU'
],
}
}
SUBDOMAIN_BRANDING
=
{
SUBDOMAIN_BRANDING
=
{
'sjsu'
:
'MITx'
,
'sjsu'
:
'MITx'
,
'mit'
:
'MITx'
,
'mit'
:
'MITx'
,
...
@@ -94,6 +98,8 @@ SUBDOMAIN_BRANDING = {
...
@@ -94,6 +98,8 @@ SUBDOMAIN_BRANDING = {
COMMENTS_SERVICE_KEY
=
"PUT_YOUR_API_KEY_HERE"
COMMENTS_SERVICE_KEY
=
"PUT_YOUR_API_KEY_HERE"
################################ LMS Migration #################################
################################ LMS Migration #################################
MITX_FEATURES
[
'ENABLE_LMS_MIGRATION'
]
=
True
MITX_FEATURES
[
'ENABLE_LMS_MIGRATION'
]
=
True
MITX_FEATURES
[
'ACCESS_REQUIRE_STAFF_FOR_COURSE'
]
=
False
# require that user be in the staff_* group to be able to enroll
MITX_FEATURES
[
'ACCESS_REQUIRE_STAFF_FOR_COURSE'
]
=
False
# require that user be in the staff_* group to be able to enroll
...
@@ -116,6 +122,7 @@ OPENID_SSO_SERVER_URL = 'https://www.google.com/accounts/o8/id' # TODO: accept m
...
@@ -116,6 +122,7 @@ OPENID_SSO_SERVER_URL = 'https://www.google.com/accounts/o8/id' # TODO: accept m
OPENID_USE_AS_ADMIN_LOGIN
=
False
OPENID_USE_AS_ADMIN_LOGIN
=
False
################################ MIT Certificates SSL Auth #################################
################################ MIT Certificates SSL Auth #################################
MITX_FEATURES
[
'AUTH_USE_MIT_CERTIFICATES'
]
=
True
MITX_FEATURES
[
'AUTH_USE_MIT_CERTIFICATES'
]
=
True
################################ DEBUG TOOLBAR #################################
################################ DEBUG TOOLBAR #################################
...
...
lms/envs/logsettings.py
View file @
cef089f7
...
@@ -4,6 +4,7 @@ import platform
...
@@ -4,6 +4,7 @@ import platform
import
sys
import
sys
from
logging.handlers
import
SysLogHandler
from
logging.handlers
import
SysLogHandler
def
get_logger_config
(
log_dir
,
def
get_logger_config
(
log_dir
,
logging_env
=
"no_env"
,
logging_env
=
"no_env"
,
tracking_filename
=
None
,
tracking_filename
=
None
,
...
@@ -18,94 +19,91 @@ def get_logger_config(log_dir,
...
@@ -18,94 +19,91 @@ def get_logger_config(log_dir,
settings are extended."""
settings are extended."""
# Revert to INFO if an invalid string is passed in
# Revert to INFO if an invalid string is passed in
if
local_loglevel
not
in
[
'DEBUG'
,
'INFO'
,
'WARNING'
,
'ERROR'
,
'CRITICAL'
]:
if
local_loglevel
not
in
[
'DEBUG'
,
'INFO'
,
'WARNING'
,
'ERROR'
,
'CRITICAL'
]:
local_loglevel
=
'INFO'
local_loglevel
=
'INFO'
# If we're given an explicit place to put tracking logs, we do that (say for
# If we're given an explicit place to put tracking logs,
# debugging). However, logging is not safe for multiple processes hitting
# we do that (say for debugging). However, logging is not
# the same file. So if it's left blank, we dynamically create the filename
# safe for multiple processes hitting the same file.
# So if it's left blank, we dynamically create the filename
# based on the PID of this worker process.
# based on the PID of this worker process.
if
tracking_filename
:
tracking_file_loc
=
os
.
path
.
join
(
log_dir
,
tracking_filename
)
else
:
pid
=
os
.
getpid
()
# So we can log which process is creating the log
tracking_file_loc
=
os
.
path
.
join
(
log_dir
,
"tracking_{0}.log"
.
format
(
pid
))
hostname
=
platform
.
node
()
.
split
(
"."
)[
0
]
hostname
=
platform
.
node
()
.
split
(
"."
)[
0
]
syslog_format
=
(
"[
%(name)
s][env:{logging_env}]
%(levelname)
s [{hostname} "
+
syslog_format
=
(
"[
%(name)
s][env:{logging_env}]
%(levelname)
s [{hostname} "
+
"
%(process)
d] [
%(filename)
s:
%(lineno)
d] -
%(message)
s"
)
.
format
(
"
%(process)
d] [
%(filename)
s:
%(lineno)
d] -
%(message)
s"
)
.
format
(
logging_env
=
logging_env
,
hostname
=
hostname
)
logging_env
=
logging_env
,
hostname
=
hostname
)
handlers
=
[
'console'
]
if
debug
else
[
'console'
,
'syslogger-remote'
,
'syslogger-local'
,
'newrelic'
]
handlers
=
[
'console'
]
if
debug
else
[
'console'
,
'syslogger-remote'
,
'syslogger-local'
,
'newrelic'
]
return
{
return
{
'version'
:
1
,
'version'
:
1
,
'disable_existing_loggers'
:
False
,
'disable_existing_loggers'
:
False
,
'formatters'
:
{
'formatters'
:
{
'standard'
:
{
'standard'
:
{
'format'
:
'
%(asctime)
s
%(levelname)
s
%(process)
d [
%(name)
s]
%(filename)
s:
%(lineno)
d -
%(message)
s'
,
'format'
:
'
%(asctime)
s
%(levelname)
s
%(process)
d [
%(name)
s]
%(filename)
s:
%(lineno)
d -
%(message)
s'
,
},
},
'syslog_format'
:
{
'format'
:
syslog_format
}
,
'syslog_format'
:
{
'format'
:
syslog_format
,
'raw'
:
{
'format'
:
'
%(message)
s'
},
'raw'
:
{
'format'
:
'
%(message)
s'
},
},
},
'handlers'
:
{
'handlers'
:
{
'console'
:
{
'console'
:
{
'level'
:
'DEBUG'
if
debug
else
'INFO'
,
'level'
:
'DEBUG'
if
debug
else
'INFO'
,
'class'
:
'logging.StreamHandler'
,
'class'
:
'logging.StreamHandler'
,
'formatter'
:
'standard'
,
'formatter'
:
'standard'
,
'stream'
:
sys
.
stdout
,
'stream'
:
sys
.
stdout
,
},
},
'syslogger-remote'
:
{
'syslogger-remote'
:
{
'level'
:
'INFO'
,
'level'
:
'INFO'
,
'class'
:
'logging.handlers.SysLogHandler'
,
'class'
:
'logging.handlers.SysLogHandler'
,
'address'
:
syslog_addr
,
'address'
:
syslog_addr
,
'formatter'
:
'syslog_format'
,
'formatter'
:
'syslog_format'
,
},
},
'syslogger-local'
:
{
'syslogger-local'
:
{
'level'
:
local_loglevel
,
'level'
:
local_loglevel
,
'class'
:
'logging.handlers.SysLogHandler'
,
'class'
:
'logging.handlers.SysLogHandler'
,
'address'
:
'/dev/log'
,
'address'
:
'/dev/log'
,
'formatter'
:
'syslog_format'
,
'formatter'
:
'syslog_format'
,
'facility'
:
SysLogHandler
.
LOG_LOCAL0
,
'facility'
:
SysLogHandler
.
LOG_LOCAL0
,
},
},
'tracking'
:
{
'tracking'
:
{
'level'
:
'DEBUG'
,
'level'
:
'DEBUG'
,
'class'
:
'logging.handlers.SysLogHandler'
,
'class'
:
'logging.handlers.SysLogHandler'
,
'address'
:
'/dev/log'
,
'address'
:
'/dev/log'
,
'facility'
:
SysLogHandler
.
LOG_LOCAL1
,
'facility'
:
SysLogHandler
.
LOG_LOCAL1
,
'formatter'
:
'raw'
,
'formatter'
:
'raw'
,
},
},
'newrelic'
:
{
'newrelic'
:
{
'level'
:
'ERROR'
,
'level'
:
'ERROR'
,
'class'
:
'newrelic_logging.NewRelicHandler'
,
'class'
:
'newrelic_logging.NewRelicHandler'
,
'formatter'
:
'raw'
,
'formatter'
:
'raw'
,
}
}
},
},
'loggers'
:
{
'loggers'
:
{
'django'
:
{
'django'
:
{
'handlers'
:
handlers
,
'handlers'
:
handlers
,
'propagate'
:
True
,
'propagate'
:
True
,
'level'
:
'INFO'
'level'
:
'INFO'
},
},
'tracking'
:
{
'tracking'
:
{
'handlers'
:
[
'tracking'
],
'handlers'
:
[
'tracking'
],
'level'
:
'DEBUG'
,
'level'
:
'DEBUG'
,
'propagate'
:
False
,
'propagate'
:
False
,
},
},
''
:
{
''
:
{
'handlers'
:
handlers
,
'handlers'
:
handlers
,
'level'
:
'DEBUG'
,
'level'
:
'DEBUG'
,
'propagate'
:
False
'propagate'
:
False
},
},
'mitx'
:
{
'mitx'
:
{
'handlers'
:
handlers
,
'handlers'
:
handlers
,
'level'
:
'DEBUG'
,
'level'
:
'DEBUG'
,
'propagate'
:
False
'propagate'
:
False
},
},
'keyedcache'
:
{
'keyedcache'
:
{
'handlers'
:
handlers
,
'handlers'
:
handlers
,
'level'
:
'DEBUG'
,
'level'
:
'DEBUG'
,
'propagate'
:
False
'propagate'
:
False
},
},
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment