How to disable debug messages on sockjs- STOMP

J.R. picture J.R. · Sep 5, 2014 · Viewed 19.2k times · Source

I have the follow situation:

 var options = {
        protocols_whitelist : [ "websocket", "xhr-streaming", "xdr-streaming", "xhr-polling", "xdr-polling", "iframe-htmlfile", "iframe-eventsource", "iframe-xhr-polling" ],
        debug : false
    };

    var socket = new SockJS("/mmyurl/",undefined,options);
    var stompClient = Stomp.over(socket);
    stompClient.connect({
        company : "XXXXX"
    }, function(frame) {
        stompClient.subscribe('/topic/mytopic', function(message){ 
            var myitem = JSON.parse(message.body);

        });

all works fine, the problem is that on the javascript console is full of debug messages like this:

<<< MESSAGE
content-type:application/json;charset=UTF-8
subscription:sub-1
message-id:o6g660dt-113
destination:/topic/mytopic
content-length:411

And I want to disable the messages.

I tried to change some option and also tried to register simply:

var socket = new SockJS("/mmyurl/");

but it doesn't work.

Is there a way to disable the debug messages?

Any help is appreciated

Answer

J.R. picture J.R. · Sep 5, 2014

Ok I found a solution.

I added this code:

stompClient.debug = null

In this way, the debug function is disabled.