NoMachine Support

Your questions answered

Knowledge Base

Searching in: Feature Requests
Filter the search results
Target version:
Products:
Status:
Last update:
Searching in: Feature Requests
ID: FR01L02806
Added on:  2014-01-20
Last update: 2019-02-22
Priority: High
Products: NoMachine Server
Target: 6
Status:  Implemented
Giving the possibility to activate log rotation for NoMachine log files

It should be possible to activate an automatic mechanism to archive NoMachine dated log files (log rotation). This can be helpful especially when the debug log level is enabled and log files are growing larger and need to be cleaned up.

To rotate logs on a per-time basis:

nxserver --logrotateadd --timeinterval <TIME>

TIME can be specified in seconds or by using any of these keywords: Daily or Weekly or Monthly or Yearly.

or on a per-size basis:

nxserver --logrotateadd --size <SIZE>

SIZE is in kilobytes
 

If not otherwise specified, the logrotate function will be activated for all logs, i.e.:

 nxserver.log
 nxerror.log
 nxd.log
 nxservice.log (on Windows only)
*nxwebclient.log
*nxhtd-error.log
*nxhtd-access.log
*Logs file related to web sessions are not present in the NoMachine free version and in the Terminal Server Node installations.

 

To apply log rotation to a single log file, provide the name of the log file. For example:

nxserver --logrotateadd nxserver.log --timeinterval Weekly

If not otherwise specified, the number of logorotated files that are preserved is 7.
They are stored in the <NoMachine installation directory>/var/log/logrotate directory.


Usage of the new server commands for managing log rotation:  

--logrotateadd [<log>] [--rotate <rotation>]
                       [--timeinterval <timeinterval>]
                       [--minsize <minsize>]
                       [--size <size>]
                       [--compress yes|no]
                       [--destination <path>]

Enable the automatic rotation of NoMachine logs. If log type is not
given, it applies to all log files. Provide --rotate to specify the
maximum number of rotated files to be preserved, by default 7. Use
--timeinterval to set frequency of rotation. Time can be specified
in seconds or by using 'Daily', 'Weekly', 'Monthly', or 'Yearly'
keywords. Use it in conjunction with --minsize to rotate the file
only when it exceeds the given size (in kilobytes). If --size is
given, apply rotation when the file exceeds the given size, regard-
less of time frequency. Values for both size options are by default
in kilobytes, add M or G to set value in megabytes or gigabytes.
By default the log file is compressed as gz archive, use '--compress
no' to not compress it. Rotated files are saved in var/log/logrotate
under the NoMachine installation directory. Provide the --destination
switch to change location.

--logrotateedit <log> --rotate <rotation> |
                      --timeinterval <timeinterval> |
                      --minsize <minsize> | --size <size>|
                      --compress yes|no |
                      --destination <destination>

Edit log rotation settings specified for the given log type. Multiple
options can be provided in the same command line.

--logrotatedel [<log>]

Remove log rotation rules set for all log types. Specify <log> to
remove rules set for the given log type.

--logrotatelist [<log>]

List log rotation settings enabled for all log types or only those
set for the given type.

--logrotate [<log>] [--compress yes|no] [--destination <destination>]

Force all log types to rotate or force only the given log type. Log
file is compressed as gz archive, use --compress no to not compress
it. Rotated files are saved in the var/log/logrotate directory of
NoMachine, to change location provide the --destination switch.