All About Logging

Follow

By default, VNC Viewer and VNC Server record basic information about connection activity. As of version 6.7.0 of VNC Server and version 6.20.113 of VNC Viewer, logging is automatically enabled to event logs or syslog (depending on the operating system) along with logging to a file. The file used for logging can be changed using parameters.

The following table lists the default destination for output from VNC Server (as determined by the Log parameter) and VNC Viewer (also determined by the Log parameter): 

Program Windows Mac Linux
 VNC Server Service Mode

 Event Log 
(see note 3)

C:\ProgramData\RealVNC-Service\vncserver.log

 

 syslog

~\:Library\Logs\vncserver.log

 

 syslog, to the USER facility (see note 5)

/var/log/vncserver-x11.log

User Mode

C:\Users\<user>\AppData\Local\RealVNC\vncserver.log

(see note 4)

~/Library/Logs/vnc/vncserver.log ~/.vnc/vncserver-x11.log 
Virtual Mode      Standard Error (see note 6)
Virtual  Mode daemon      syslog, to the DAEMON facility (see also note 7)
 VNC Viewer  Standard Error  Standard Error  Standard Error

The following notes apply to the table above:

  1. Logging to file is determined by the LogDir and LogFile parameters. Please note that the destination file and directory must have writable permissions for a standard user account and must not require administrative privileges to view / write to.
  2. The destination files contents are overwritten each time the program is restarted. To preserve information, choose a different destination, f. For example, “Standard Error.”. You could still redirect this to file using the command below.

    Vncserver-x11 -Log=*:stderr:100 2>>filename

  3. VNC Server and VNC Viewer require Windows Event Log Service to be running, and that Event Viewer > Windows Logs > Application > Properties is set to overwrite as needed.

    If the service is not running or the event log is full, connections cannot be established.

  4. This is the location for Windows 7. Please note AppData may be hidden by default and the location may vary depending on your version of Windows.
  5. Using Linux, VNC Server running in Service mode. can be configured to log to different facilities using the SyslogFacility parameter.
  6. Using Linux, the default destination for VNC Server in Virtual mode is Standard error. However, vncserver-virtual (or the vncserver symlink) automatically redirects this to file at:

    ~/.vnc/<computer>:<display-number>.log

    Please note that the output of the x server session is included.

  7. Using Linux each time a user connects to the VNC Server using the virtual mode daemon, a new instance of VNC Server in virtual mode is immediately started. Its log output automatically redirects to file.
  8. From version 6.7.0 of VNC Server, default logging to event logs / syslog defaults to level 10. Logging to file across all supported operating systems now defaults to level 30 from version 6.7.0 of VNC Server. The same applies to version 6.20.113 of VNC Viewer.

Under Linux or Mac, VNC Server also automatically logs connections authenticated using system authention or single sign-on schemes to the syslog AUTHPRIV facility. This is typically located at /var/log/auth.log and /var/log/secure/log respectively.

Quickly generating debug logs

You may be eligible to contact Support if you encounter a problem or require assistance.

The Support team rely on comprehensive debug log files to troubleshoot problems, equivalent to setting the VNC Server and VNC Viewer Log parameters to *:file:100.

In order to quickly generate a debug log file for either VNC Server or VNC Viewer:

  1. On the Troubleshooting page of the Options or Properties dialog respectively, choose Create a debug log file, and then OK.
  2. Restart the program.
  3. Recreate the problem, and send the file in the specified location to the Support team.

Recording information about other programs and sub-processes

The Log, LogFile and LogDir parameters can be used to record information about VNC Connect programs – excluding VNC Viewer and VNC Server – along with its sub-processes. This may be useful if the Support team requests that you dig deeper into any problems you may encounter.

Windows

You can apply the above parameters to the following programs and sub-processes by creating special keys in the Windows Registry or for other programs via the command line.

Program or sub-process Registry key Parameters can be applied... Registry hive
 VNC Server  Service Mode user interface  vncserverui-service  Registry  HKEY_CURRENT_USER
 User Mode user interface  vncserverui-user
 Licensing  At the command line  vnclicense  Registry or command line
 Using the Licensing Wizard  vnclicensewiz

For example, to create a log file for the VNC Server in Service Mode user interface:

  1. Using Registry Editor, navigate to HKEY_CURRENT_USER\Software\RealVNC.
  2. Select New > Key from the shortcut menu, and create vncserverui-service.
  3. Select New > String Value from the shortcut menu, and create Log.
  4. Select Modify from the shortcut menu, and specify appropriate Value data, for example *:file:100.

Repeat steps 3 and 4 for the LogFile and LogDir parameters, if necessary. Restart the program to create the new log file.

To create a log file for a program at the command line, apply parameters before any command, for example:

vnclicense.exe -Log=*:file:100 -LogFile=license.log -add <key>

Linux

You can apply parameters to the following programs when run from the command line:

  • vnclicense
  • vnclicensewiz

Do so before any command, for example:

vnclicense -Log=*:file:100 -LogDir=/home/dev/logs -add <key>

Mac

You can apply the logging parameters to the following programs when run from the command line:

  • vnclicense
  • vnclicensewiz

Do so before any command, for example:

/Library/vnc/VNC\ Server\ Licensing.app/Contents/MacOS/vnclicensewiz -Log=*:file:100

*Two files are created for the VNC Server Licensing Wizard: ~/Library/Logs/vnc/vnclicensewiz.log and /Library/Logs/vnclicensewiz_helper.log.

Mac OS Catalina requires you change the shell to bash before running this command. 

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.