Set up logging

Example files for NLog are available in the Example folder which is available in the AlfabetWebApplication , AlfabetAPIServer , and Programs directory. The folders contain all or the relevant subset of the following examples for different use cases:

To implement logging:

  1. If not already available, create a directory config under the AlfabetWebApplication , AlfabetAPIServer , and Programs directory respectively.
  2. Copy the nlog-alfabet.config file from the relevant example configuration you want to use and paste it to the folder.

    NLog configuration files are usually located in the working directory of a component and are named nlog.config . For the Alfabet Web Application and the Alfabet API server, the working directory contains an nlog.config file re-directing NLog to the config/nlog-alfabet.config file in the config sub-directory.

    The file is overwritten on each update of a release.

    You can use such a configuration to locate the configuration file in any other location the Alfabet components have ReadWrite access to. The nlog.config file in the working directory of the Alfabet component must then contain a link to the actual configuration file only:

    • <nlog>
      • <include file="..\nlog.config" />
    • </nlog>

    You can use the same central NLog configuration file for all Alfabet components.

    If you changed the configuration file in the root directory of the Alfabet Web Application or the Alfabet API server, you need to store a copy outside the root directory and copy it back after each upgrade to a new Alfabet release.

  3. Open the configuration file in a text editor and adapt the example configuration to your needs. Configuration consists of two phases:
  4. Save the file. The changes are immediately applied. You do not need to restart the Alfabet components.