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
27725ab6
Commit
27725ab6
authored
Aug 29, 2012
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
making loglevel configurable for local logging
parent
2e1c8666
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
lms/envs/aws.py
+2
-0
lms/envs/logsettings.py
+8
-2
No files found.
lms/envs/aws.py
View file @
27725ab6
...
...
@@ -48,10 +48,12 @@ for feature, value in ENV_TOKENS.get('MITX_FEATURES', {}).items():
MITX_FEATURES
[
feature
]
=
value
WIKI_ENABLED
=
ENV_TOKENS
.
get
(
'WIKI_ENABLED'
,
WIKI_ENABLED
)
local_loglevel
=
ENV_TOKENS
.
get
(
'LOCAL_LOGLEVEL'
,
'INFO'
)
LOGGING
=
get_logger_config
(
LOG_DIR
,
logging_env
=
ENV_TOKENS
[
'LOGGING_ENV'
],
syslog_addr
=
(
ENV_TOKENS
[
'SYSLOG_SERVER'
],
514
),
local_loglevel
=
local_loglevel
,
debug
=
False
)
COURSE_LISTINGS
=
ENV_TOKENS
.
get
(
'COURSE_LISTINGS'
,
{})
...
...
lms/envs/logsettings.py
View file @
27725ab6
...
...
@@ -8,13 +8,19 @@ def get_logger_config(log_dir,
logging_env
=
"no_env"
,
tracking_filename
=
None
,
syslog_addr
=
None
,
debug
=
False
):
debug
=
False
,
local_loglevel
=
'INFO'
):
"""Return the appropriate logging config dictionary. You should assign the
result of this to the LOGGING var in your settings. The reason it's done
this way instead of registering directly is because I didn't want to worry
about resetting the logging state if this is called multiple times when
settings are extended."""
# Revert to INFO if an invalid string is passed in
if
local_loglevel
not
in
[
'DEBUG'
,
'INFO'
,
'WARNING'
,
'ERROR'
,
'CRITICAL'
]:
local_loglevel
=
'INFO'
# If we're given an explicit place to put tracking logs, we do that (say for
# debugging). However, logging is not safe for multiple processes hitting
# the same file. So if it's left blank, we dynamically create the filename
...
...
@@ -56,7 +62,7 @@ def get_logger_config(log_dir,
'formatter'
:
'syslog_format'
,
},
'syslogger-local'
:
{
'level'
:
'DEBUG'
,
'level'
:
local_loglevel
,
'class'
:
'logging.handlers.SysLogHandler'
,
'address'
:
'/dev/log'
,
'formatter'
:
'syslog_format'
,
...
...
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