Custom Logger Configuration

The instruction below illustrates the basic steps for adding custom settings to Cinegy Convert Client and enabling/disabling different logging types (user log, machine log, etc.), using the predefined schema.

Navigate to C:\Program Files\Cinegy\Convert Client folder and select the Convert.Client.exe.config file:

Convert_Client_config_file

Open the app.config XML file and add the following parameters:


<configuration>
    <configSections>
        ...
        <section name="SECTION_CUSTOM_NAME" type="Cinegy.Logging.Configuration.LoggingConfigurationSection,
         Cinegy.Base.NLog"/>
         ...
    </configSections>
    <SECTION_CUSTOM_NAME>
        <file Level="Trace" ArchiveAboveSize="1073741824" ArchiveEvery="Day"
         Directory="d:\123\"/>
        <telemetryFile Level="Trace" ArchiveAboveSize="1073741824"
        ArchiveEvery="Day" Directory="d:\123\"/>
        <elasticSearch Level="Trace" Index="Some_Organization"
         Url="http://analytics1.cinegy.net" Username="admin" Password="admin" Tags="hello tag,third_tag"/>-->
    </SECTION_CUSTOM_NAME>
</configuration>

The SECTION_CUSTOM_NAME stands for any random name, the default name is "logging". The SECTION_CUSTOM_NAME section contains unlimited number of logger targets and refer to the following types:

FILE target

Attributes:

  1. Level – defines one of the following available log levels, ordered from least to highest severity:

    • Trace – logs for information used for debugging that may contain sensitive application data.
      Example: Credentials: {"User":"someuser", "Password":"P@ssword"}

    • Debug – logs for short-term information used for development and debugging.
      Example: Entering method Configure with flag set to true.

    • Info – logs for general application flow tracking with long-term value.
      Example: Request received for path /api/todo

    • Warn – logs for unexpected events in the application flow like errors, exceptions or conditions that do not cause application crash.
      Example: FileNotFoundException for file quotes.txt.

    • Error – logs for errors, non-application wide failures, exceptions and failure in the current activity or operation.
      Example: Cannot insert record due to duplicate key violation.

    • Fatal – logs for failures like data loss scenarios that require immediate attention.

    The default value for "Level" attribute is "Info".

  2. ArchiveAboveSize – the maximum size for archiving file in bytes. The possible range is 1 to Int64.Max. The default value is "1024*1024*1024" bytes.

  3. ArchiveEvery – the period mode for archiving file. Possible values are: None, Year, Month, Day, Hour, Minute. The default value is "Day".

  4. MaxArchiveFiles – the maximum number of archiving files. The possible range is 0 to Int32.Max. The default value is "0".

  5. Directory – the log files output directory. The possible value is any file path. The default value is Product.SettingsFolder + "\Logs\".

The filename pattern is built-in parameter. Use the {loggerName}.log for specific logger and log.log for generic logger.

Example: <file Level="Trace" ArchiveAboveSize="1073741824" ArchiveEvery="Day" Directory="d:\123\" MaxArchiveFiles="0"/>

TELEMETRYFILE target

Attributes:

  1. Level – defines one of the following available log levels, ordered from least to highest severity: Trace, Debug, Info, Warn, Error, Fatal. The default value is "Info".

  2. ArchiveAboveSize – the maximum size for archiving file in bytes. The possible range is 1 to Int64.Max. The default value is "1024*1024*1024" bytes.

  3. ArchiveEvery – the period mode for archiving file. Possible values are: None, Year, Month, Day, Hour, Minute. The default value is "Day".

  4. MaxArchiveFiles – the maximum number of archiving files. The possible range is 0 to Int32.Max. The default value is "0".

  5. Directory – the log files output directory. The possible value is any file path. The default value is: Product.SettingsFolder + "\Logs\".

The filename pattern is built-in parameter. Use the {loggerName}.log for specific logger and log.log for generic logger.

Example: <telemetryFile Level="Trace" ArchiveAboveSize="1073741824" ArchiveEvery="Day" Directory="d:\123\" MaxArchiveFiles="0"/>

ELASTICSEARCH

Attributes:

  1. Level – defines one of the following available log levels, ordered from least to highest severity: Trace, Debug, Info, Warn, Error, Fatal.

  2. Index – custom organization index substitution into elastic index. The default value is "null".

  3. Url – the url to elastic search server. The default value is: http://analytics1.cinegy.net

  4. Tags – the custom comma separated tags. The default value is "empty string".

  5. Username/Password – credentials to access elastic search server. The settings will be applied only if both fields are filled in.

The index file pattern is built-in parameter: {productName}(-index)-${date:format=yyyy.MM.dd}. The index parameter is optional.

Example: <telemetryFile Level="Trace" ArchiveAboveSize="1073741824" ArchiveEvery="Day" Directory="d:\123\" MaxArchiveFiles="0"/>