Microsoft Nano Server
This topic describes how to install and upgrade NXLog on a Microsoft Windows Nano Server. It also includes instructions on how to install using a custom directory and how to change the service startup type.
Installing
Follow these steps to deploy NXLog on a Microsoft Nano Server system.
Microsoft Nano Server does not support the installation of MSI files. In its place, Microsoft introduced the APPX format. The sandboxing and isolation imposed by the APPX format was found to be an unnecessary complication when deploying NXLog; therefore, users are provided with a ZIP file that allows for manual installation instead. |
First, download the NXLog ZIP archive from the NXLog website.
-
Log in to your account, then click My account at the top of the page.
-
Under the Downloads > NXLog Enterprise Edition files tab, download
nxlog-6.4.9638_nano.zip
. -
Transfer the NXLog ZIP file to the Microsoft Nano Server. One way to do so is to use WinRM and the
Copy-Item
cmdlet. Uncompress the ZIP file atC:\Program Files\nxlog
using theExpand-Archive
cmdlet as shown below.PS C:\tmp> Expand-Archive -Path nxlog-6.4.9638_nano.zip -DestinationPath 'C:\Program Files\nxlog'
-
To register NXLog as a service, navigate to the installation directory and execute the following.
PS C:\Program Files\nxlog> .\nxlog.exe -i
-
Configure NXLog by editing the
C:\Program Files\nxlog\nxlog.conf
file. General information about configuring NXLog can be found in Configuration. For more details about configuring NXLog to collect logs on Windows, see the Microsoft Windows summary.Because Microsoft Nano Server does not have a native console editor, the configuration file must be edited on a different system and then transferred to the Nano Server. Alternatively, a third party editor could be installed. -
Verify the configuration file syntax.
PS C:\Program Files\nxlog> .\nxlog.exe -v -c nxlog.conf 2018-09-12 19:15:55 INFO configuration OK
NXLog in now installed, registered, and configured. The NXLog
service can be started by running Start-Service nxlog
.
Installing in a Custom Directory
This section deals with installation options outside the typical scenario.
The following installation options require altering the Windows Registry. Incorrect modifications could potentially render the system unusable. Always double check the commands and ensure it will be possible to revert to a known working state before altering the registry. |
NXLog can be installed in a non-default location on Nano Server.
-
Follow the same installation procedure outlined above, but choose a different
DestinationPath
when expanding the ZIP file. Also register the NXLog service as shown above. -
At this point the registry entry for the NXLog service needs to be altered. View the current setting:
PS C:\> Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\nxlog" Type : 16 Start : 2 ErrorControl : 0 ImagePath : "c:\Program Files\nxlog\nxlog.exe" -c "c:\Program Files\nxlog\nxlog.conf" DisplayName : nxlog DependOnService : {eventlog} ObjectName : LocalSystem PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\nxlog PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services PSChildName : nxlog PSDrive : HKLM PSProvider : Microsoft.PowerShell.Core\Registry
-
The value of the
ImagePath
parameter needs to be modified in order to update the location of both the NXLog executable and the configuration file. For example, if NXLog is installed inC:\nxlog
, run the following command to update the registry key.PS C:\> Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\nxlog" -Name "ImagePath" -Value '"C:\nxlog\nxlog.exe" -c "C:\nxlog\nxlog.conf"'
-
The configuration file (
nxlog.conf
) also needs to be edited to reflect this change to a non-default installation directory. Make suredefine ROOT
points to the correct location.
Service startup type
The service Startup type of newer versions of NXLog defaults to
Automatic (Delayed Start) instead of Automatic. This is controlled by the
DelayedAutostart
parameter. To revert back to the old behavior, run the
following command.
PS C:\> Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\nxlog" -Name "DelayedAutostart" -Value 0
This command requires altering the Windows Registry. Incorrect modifications could potentially render the system unusable. Always double check the commands and ensure it will be possible to revert to a known working state before altering the registry. |
Upgrading
To upgrade NXLog to the latest release, follow these steps. It is recommended to make a backup of the configuration files before starting this process.
-
Stop the NXLog service by issuing the command
Stop-Service nxlog
. -
Back up any configuration files that have been altered, such as
nxlog.conf
,managed.conf
, and any certificates. -
Either delete the
nxlog
directory and follow the installation procedure again or use the-Force
parameter when extracting the NXLog ZIP file. There is no need to register the service again.PS C:\tmp> Expand-Archive -Force -Path nxlog-6.4.9638_nano.zip -DestinationPath 'C:\Program Files\nxlog'
-
Restore any configuration files and certificates.
-
Start the NXLog service by running
Start-Service nxlog
.