Errors and logging

#1

Hi,

Currently, crossbar error handling and logging is making debugging very hard.

Is there a way to :

  • disable logging ?
  • set your own global error handler ?
  • at the client level ?
  • at the server level ?
0 Likes

#2

Hi Michel,

Currently, crossbar error handling and logging is making debugging very
hard.

Need to better understand:

Are you referring to debugging WAMP application components? That is
debugging user code or Crossbar.io _itself_?

With WAMP application components, do you mean debugging an individual
components, or the interplay between different components?

Cheers,
/Tobias

···

Is there a way to :

- disable logging ?
- set your own global error handler ?
- at the client level ?
- at the server level ?

0 Likes

#3

Hello Tobias,

With crossbar, even if I start it with --logLevel trace, I don’t get many information (I would say none acutally).

Is there a way to get information like workers called or published to, with or without details.

0 Likes

#4

Just being able to handle exception in python client.

Technically, I’m expecting 3 things (for a given client):

  • being able to add an exception handler and remove the default ones;
  • being able to add a logging handler and remove the default ones;
  • being able to send the logging data to client specialized in logging (and not crossbar).

This idea is that :

  • in dev, i want exceptions to crash my client with a verbose stack trace;
  • in prod, i want errors to be dispatched to another servers so i can have an error dashboard.

I don’t need this to be coded, but I want to be able to code it.

···

On Sunday, March 15, 2015 at 3:38:16 PM UTC+1, Tobias Oberstein wrote:

Hi Michel,

Currently, crossbar error handling and logging is making debugging very

hard.

Need to better understand:

Are you referring to debugging WAMP application components? That is

debugging user code or Crossbar.io itself?

With WAMP application components, do you mean debugging an individual

components, or the interplay between different components?

Cheers,

/Tobias

Is there a way to :

  • disable logging ?
  • set your own global error handler ?
  • at the client level ?
  • at the server level ?
0 Likes

#5

ApplicationRunner will take 3 bool values for debug at differing levels (example below, there are config options too for setting these values on workers, I saw a post where Tobias is still considering how to configure debug best so there are many options…), but the question is, will the crossbar router log/terminal print them?

https://groups.google.com/forum/#!topic/crossbario/gt_JLPcFxmU

:param debug: Turn on low-level debugging.
:type debug: bool
:param debug_wamp: Turn on WAMP-level debugging.
:type debug_wamp: bool
:param debug_app: Turn on app-level debugging.

self.debug = debug
self.debug_wamp = debug_wamp

self.debug_app = debug_app

runner = ApplicationRunner(url=“wss://yourwebsite.com/ws”, realm=“realm1”, debug_wamp = True etc…)
runner.run(MyBackendComponent)

0 Likes

#6

Opened: https://github.com/crossbario/crossbar/issues/314

0 Likes

#7

https://bugs.python.org/issue11633 and https://docs.python.org/2/using/cmdline.html#cmdoption-u are related.

If you set PYTHONUNBUFFERED=1 in your config, logging works as-expected. Perhaps crossbar should just set this env-var automagically? To immediately fix the issue described, add a config snippit like this to your guest:

"options"    : {
"env"        : {
"vars"            : {
"PYTHONUNBUFFERED": "1"
        }
}
}

Crossbar config.json required a string of “1”, it would not accept JSON Int 1

You can also add "-u" to the arguments list (instead of the env-var).

         {
"id": "backend"         ,
"type": "guest"         ,
"executable": "python3"         ,
"arguments": ["backend.py"         ],
"options"            : {
"env"               : {
"vars"                  : {
"PYTHONUNBUFFERED": "1"
               }
},
"workdir": "../backend"            ,
"stdout": "log"            ,
"stderr": "log"            ,
"watch"               : {
"directories": ["../backend"               ],
"action": "restart"
            }
}
}
0 Likes