Logging Integration, ELK docker-compose as update file

This commit is contained in:
AlanCoding
2016-10-17 15:00:38 -04:00
parent dc032489c2
commit f3427d1359
28 changed files with 839 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
import json
import urlparse
import logging
from channels import Group
from channels.sessions import channel_session
@@ -8,6 +9,8 @@ from django.contrib.auth.models import User
from awx.main.models.organization import AuthToken
logger = logging.getLogger('awx.main.consumers')
def discard_groups(message):
if 'groups' in message.channel_session:
for group in message.channel_session['groups']:
@@ -52,11 +55,13 @@ def ws_receive(message):
auth_token = validate_token(token)
if auth_token is None:
logger.error("Authentication Failure validating user")
message.reply_channel.send({"text": json.dumps({"error": "invalid auth token"})})
return None
user = user_from_token(auth_token)
if user is None:
logger.error("No valid user corresponding to submitted auth_token")
message.reply_channel.send({"text": json.dumps({"error": "no valid user"})})
return None