No handlers could be found for logger “stomp.py”

风格不统一 提交于 2019-12-25 05:11:28

问题


I'm trying to get Orbited running as per instructions on http://mischneider.net/?p=125

Here's a copy of the error:

Validating models...

0 errors found
Django version 1.3, using settings 'comet.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[28/May/2011 11:43:36] "GET /comet/ HTTP/1.1" 200 2952
[28/May/2011 11:43:36] "GET /site_media/Orbited.js HTTP/1.1" 304 0
[28/May/2011 11:43:37] "GET /site_media/stomp.js HTTP/1.1" 304 0
[28/May/2011 11:44:18] "POST /addMessage/ HTTP/1.1" 403 2332
[28/May/2011 11:44:21] "POST /addMessage/ HTTP/1.1" 403 2332
[28/May/2011 11:44:40] "GET /comet/ HTTP/1.1" 200 2952
[28/May/2011 11:44:41] "GET /site_media/Orbited.js HTTP/1.1" 304 0
[28/May/2011 11:44:41] "GET /site_media/stomp.js HTTP/1.1" 304 0
No handlers could be found for logger "stomp.py"
[28/May/2011 12:00:36] "GET /comet/ HTTP/1.1" 200 2952

Also, when I load the page it gives me an error. Here's a selection of some of my files.

index.html:

<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>Django, Orbited, Stomp and Co.</title>
    <script src="http://www.json.org/json2.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script src="/site_media/Orbited.js"></script>
    <script>
    // set the orbited settings and port
    Orbited.settings.port = 9000;
    Orbited.settings.hostname = "127.0.0.1";
    //Orbited.settings.streaming = false;
    TCPSocket = Orbited.TCPSocket
    </script>
    <script> document.domain = document.domain; </script>
    <script src="/site_media/stomp.js"></script>

    <script type="text/javascript" charset="utf-8">

        function add_message(msg) {
            $("<p>" + msg["user"] + ": " + msg["message"] + " at " + msg["time"] + "</p>").appendTo("#messages")
        };
        $(document).ready(function() {
            stomp = new STOMPClient();
            stomp.onopen = function(){
                //console.log("opening stomp client");
            };
            stomp.onclose = function(c){
                alert('Lost Connection, Code: ' + c);
            };
            stomp.onerror = function(error){
                alert("Error: " + error);
            };
            stomp.onerrorframe = function(frame){
                alert("Error: " + frame.body);
            };
            stomp.onconnectedframe = function(){
                console.log("Connected. Subscribing");
                //alert("subscribing");
                stomp.subscribe("/messages");
            };
            stomp.onmessageframe = function(frame){
                // Presumably we should only receive message frames with the
                // destination "/topic/message" because that's the only destination
                // to which we've subscribed. To handle multiple destinations we
                // would have to check frame.headers.destination.
                add_message(JSON.parse(frame.body));
            };
            stomp.connect('localhost', 61613);

            $("#send").click(function(data) {
                var message = $("#message").val()
                var user = $("#user").val()
                $.post("/addMessage/", {"message":message, "user":user});
            })
        });

    </script>
</head>
<body id="index">
    <div id="messages">
        {% for message in messages %}
            <p>{{message.user}}: {{message.body}} at {{message.time|date:"H:i-d/m/Y"}}</p>
        {% endfor %}
    </div>
    <div id="new_message">
        Text: <input type="text" name="message" value="" id="message">  Name: <input type="text" name="user" value="" id="user">
        <p><button type="text" id="send" value="Submit a message">Submit a message</button><p>
    </div>

</body>

orbited.cnf

[listen]
http://:9000
stomp://:61613

[access]
* -> localhost:61613

[global]
session.ping_interval = 300

# new logging configuration using the python stdlib logging.fileConfig
[loggers]
keys = root,orbited,orbited_TCPConnectionResource

[handlers]
keys = console,errors,connections

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_orbited]
level = INFO
handlers = errors
qualname = orbited

[logger_orbited_TCPConnectionResource]
level = DEBUG
handlers = connections
qualname = orbited.cometsession.TCPConnectionResource

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = INFO
formatter = generic

[handler_errors]
class = FileHandler
args = ('error.log', 'w')
level = INFO
formatter = generic

[handler_connections]
class = FileHandler
level = DEBUG
formatter = generic
args = ('connections.log', 'w')

[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s

urls:

from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

from django.conf.urls.defaults import *
from stompapp.views import *

urlpatterns = patterns('',
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': 'C:/Users/Hunter/DjangoBackup/comet/static'}),
    (r'^comet/', index),
    (r'^addMessage/', addMessage),
    (r'^site_media/(.*)$', 'django.views.static.serve', {'document_root': 'PATH_TO_YOUR_STATIC_FOLDER'}),
)

I hope my problem is somewhere in there? Thanks for the help :D


回答1:


Also, when I load the page it gives me an error.

What exactly error? I guess you are talking something else than "No handlers could be found for logger "stomp.py"" message?



来源:https://stackoverflow.com/questions/6159481/no-handlers-could-be-found-for-logger-stomp-py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!