User Tools

Site Tools


wiki:development:debugging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:development:debugging [2012/09/13 11:02]
sunweaver [X2Go Debugging]
wiki:development:debugging [2018/03/15 11:40] (current)
ionic Nope, we mean hyphens, not dashes.
Line 1: Line 1:
-====== X2Go Debugging ======+====== Debugging X2Go Components ======
  
 +===== Log File Watching =====
  
-===== X2Go Server Debugging ===== +If you want to track down problems with the server-side components of X2Go, it is possible to enable output of debug information into the systems syslog facility (normally ''/var/log/syslog'').
- +
-If you want to track down problems with the ''x2goserver'' or the ''cups-x2go'' code, it is possible to enable output of debug information into the systems syslog facility (normally ''/var/log/syslog'').+
  
 The default log levels for ''x2goserver'' and ''cups-x2go'' are set to ''notice''. Available log levels are: emerg, crit, alert, err, warning, notice, info, debug. The default log levels for ''x2goserver'' and ''cups-x2go'' are set to ''notice''. Available log levels are: emerg, crit, alert, err, warning, notice, info, debug.
  
-===== Log File Watching ===== +While testing e.g. your X2Go server, you can open another terminal on the server and watch the ''syslog'' file:
- +
-While testing your X2Go server, you can open another terminal on the server and watch the ''syslog'' file:+
  
 <code> <code>
Line 16: Line 13:
 </code> </code>
  
-===== Debugging x2goserver =====+Other logging locations apart from the system's log are: 
 + 
 +  * X2Go Server: ''/var/log/syslog'' 
 +  * X2Go Client: stderr (use ''%%--debug%%''
 +  * PyHoca-GUI: stderr (use ''%%--libdebug --debug%%''
 +  * Xsession itself: ''$HOME/.xsession-x2go-errors'' 
 +  * NX (server-side): ''$HOME/.x2go/C-<sessionid>/session.*'' 
 +  * NX (client-side): ''$HOME/.x2go/S-<sessionid>/session.*'' 
 + 
 +===== Enable Debug Output ===== 
 + 
 +==== Debugging X2Go Server ====
  
 The ''x2goserver'' log level can be set by editing: The ''x2goserver'' log level can be set by editing:
Line 24: Line 32:
 </file> </file>
  
-===== Debugging cups-x2go =====+==== Debugging cups-x2go ====
  
 For debugging cups-x2go there are two files to look at: For debugging cups-x2go there are two files to look at:
Line 40: Line 48:
  
 <file> <file>
-root@x2goserver:~$ editor /etc/cups/cups-x2go+root@printserver:~$ editor /etc/cups/cups-x2go
 </file> </file>
 +
 +==== Debugging X2Go Session Broker ====
 +
 +The ''x2gobroker'' debug mode can be enabled in:
 +
 +<file>
 +root@broker:~$ editor /etc/default/python-x2gobroker
 +</file>
 +
 +The log files normally get written to ''/var/log/x2gobroker/*.log''
 +
 +You can also run 
 +<file>
 +root@broker:~$ x2gobroker-daemon-debug
 +</file>
 +
 +as user ''root''. This is equivalent to running the broker daemon provided by the package ''x2gobroker-daemon'', but you will see all output piped to stderr while the X2Go Session Broker daemon runs in foreground mode.
 +==== Python X2Go / PyHoca Debugging ====
 +
 +The PyHoca clients both have a ''%%--libdebug%%'' option. Run ''pyhoca-gui'' or ''pyhoca-cli'' from the command line with that option enabled and you get blasted with debug output.
  
 ===== Customizing Debug Messages ===== ===== Customizing Debug Messages =====
  
-All X2go server scripts are ready for syslogging, though not all of them actually do log to syslog. If you want to add your own syslog messages for debugging purposes, please take a look at the code of files that already do report to syslog. Here is a little howto that explains how to add extra log output to X2go server scripts:+All X2go server scripts are ready for syslogging, though not all of them actually do log to syslog. If you want to add your own syslog messages for debugging purposes, please take a look at the code of files that already do report to syslog.
 + 
 +Here is a little howto that explains how to add extra log output to X2go server scripts:
  
-==== Logging in X2Go Perl Scripts ====+==== Logging in X2Go Server'Perl Scripts ====
  
-Whereever you want to write a line to syslog from an X2Go Perl script, place this command:+Whereever you want to write a line to syslog from an X2Go Server'Perl script, place this command:
  
 <code> <code>
Line 56: Line 86:
  
  
-==== Logging in X2go Shell/Bash Scripts ====+==== Logging in X2Go Server'Shell/Bash Scripts ====
  
 Whereever you want to write a line to syslog from an X2Go Shell/Bash script, place this command: Whereever you want to write a line to syslog from an X2Go Shell/Bash script, place this command:
Line 64: Line 94:
 </code> </code>
  
-====== Python X2Go / PyHoca Debugging ====== 
  
-The PyHoca clients both have a ''--libdebug'' option. Run ''pyhoca-gui'' or ''pyhoca-cli'' from the command line with that option enabled and you get blasted with debug output.+==== Logging in X2Go Session Broker's Python Module ====
  
 +Whereever you want to write a line to ''/var/log/x2gobroker/broker.log'' from one of the python-x2gobroker module files, place this command:
 +
 +<code>
 +# at the top of the module file:
 +from x2gobroker.loggers import logger_broker
 +# [...] then further below, wherever needed:
 +logger_broker.debug('<your message>')
 +</code>
  
  
wiki/development/debugging.1347534173.txt.gz · Last modified: 2013/03/08 13:31 (external edit)