How to Configure Web Server Logging on Windows OS for NetScaler High Availability

How to Configure Web Server Logging on Windows OS for NetScaler High Availability

book

Article ID: CTX123504

calendar_today

Updated On:

Description

This article contains information on how to configure Web Server Logging on a Windows operating system for NetScaler appliances in a High Availability pair and verify if the configuration is working as expected.

Requirements

  • Before you configure the Web Logging for a NetScaler appliance, ensure that you have enabled the Web Logging feature on the appliance. To enable the feature, run the following command from the command line interface of the appliance:
    > enable ns feature WL
  • You must open the 3011 TCP port between NetScaler IP (NSIP) address and Weblogging clients if there is any firewall between them.

Instructions

To configure Web Server Logging on a computer with Windows operating system installed on it, complete the following procedure on the computer:

  1. Download the nswl_win-<Build_Number>.zip file from https://www.citrix.com/downloads.html.
    Ensure that you download the NSWL client for the same release and build that is running on the NetScaler appliance because the client is version dependant. If the client for the release installed on the NetScaler appliance is not available on the Citrix downloads site, then contact Citrix Support for assistance.

  2. Extract the contents of the nswl_win-<Build_Number>.zip file on the local computer.
    After extracting the content of the nswl_win-<Build_Number>.zip file, the /bin, /etc and /samples folders are created on the computer. The /etc folder contains the log.conf file and the /bin folder contains the nswl.exe file.

  3. Run the following command to install the nswl.exe file as a Windows service:
    > nswl -install –f <Configuration_File_Path>
    Netscaler Weblogging Service installed.
    Done !!

    You can also start the nswl client from the command line interface after adding a NetScaler IP (NSIP) address.

  4. Run the following command once for each NetScaler appliance in the high availability pair to configure the respective IP addresses of the primary and secondary appliances for Web Logging:
    > nswl -addns -f <Configuration_File_Path>
    NSIP: <NSIP_Address_of_NetScaler_Appliance>
    userid: <NetScaler_User_ID>
    password: <Password>
    Done !!

    For example, if the NSIP addresses for the NetScaler appliances are 10.102.14.190 and 10.102.14.200, then run the following commands:
    > nswl -addns -f .\etc\log.conf
    NSIP: 10.102.14.190
    userid: nsroot
    password: <Password>
    Done !!


    > nswl -addns -f .\etc\log.conf
    NSIP: 10.102.14.200
    userid: nsroot
    password: <Password>
    Done !!

  5. Run the following command to start the NSWL client:
    >nswl -start -f <Configuration_File_Path>
    Debug log file is ./nswl.log-271120091611 & Log level is 1
    Configuration file is correct

    Alternatively, you can use the Service Console to start the Windows service.
To verify if the Web Logging is configured and working as expected on a computer with Windows operating system installed on it, perform any of the following tasks:
  • Open the /etc/log.conf file in a text editor, such as Notepad, and verify if the IP addresses of the NetScaler appliances you have configured. The following is an excerpt from a sample log.conf file and the sample IP addresses are highlighted in bold face for your reference:

    ##########
    # This is the NSWL configuration file
    # Only the default filter is active
    # Remove leading # to activate other filters
    ##########
    
    ##########
    # Default filter (default on)
    # W3C Format logging, new file is created every hour or on reaching 10MB file size,
    # and the file name is Exyymmdd.log
    ##########
    Filter default
    
    begin default
    logFormat W3C
    logInterval Hourly
    logFileSizeLimit 10
    logFilenameFormat e:/test/Ex%{%y%m%d}t.log
    end default
      ########## END FILTER CONFIGURATION ##########
 
NSIP 10.102.14.190 username nsroot password 230:1>0:1754434651,>*4*71>+3,33=/>3=-1+2-:(5(2-5,9*952.>6=1>,<77
NSIP 10.102.14.200 username nsroot password 230:1>0:1754434651,>*4*71>+3,33=/>3=-1+2-:(5(2-5,9*952.>6=1>,<77
  • Open the nswl.log-xxxxxxxxxxxx file in a text editor, such as Notepad, and verify that the NSWL is installed and working as expected. In the file name, xxxxxxxxxxxx is a number based on date and time stamp of the log file. The following is an excerpt from a sample nswl.log file:

    NSIP : :10.102.14.190 username nsroot password #####
    NSIP : :10.102.14.200 username nsroot password #####
    RPC Signature is valid
    Login successful (wsip=10.102.14.200:user=nsroot:socket=1820)
    RPC Signature is valid
    Login successful (wsip=10.102.14.190:user=nsroot:socket=1804)
    RPC Signature is valid
    Logmsg successful (wsip=10.102.14.190:user=nsroot:socketid=1804)
    RPC Signature is valid
    Logmsg successful (wsip=10.102.14.200:user=nsroot:socketid=1820)

Issue/Introduction

This article contains information on how to configure Web Server Logging on a Windows operating system for NetScaler appliances in a High Availability setup.

Additional Information

Citrix Documentation - Web Server Logging
CTX200904 - How to Configure Web Server Logging on Windows OS for Standalone NetScaler