Custom Logger Configuration

The instruction below illustrates the basic steps for adding custom settings to Cinegy Convert Monitor and enabling/disabling different logging types (user log, machine log, etc.), using the predefined schema.
Navigate to the C:\Program Files\Cinegy\Convert Monitor folder and select the Convert.Monitor.exe.config file:

Convert_Monitor_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 an unlimited number of logger targets and refers 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 the 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 the application to crash.
      Example: FileNotFoundException for file quotes.txt.

    • Error – logs for errors, non-application-wide failures, exceptions, and failures 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 the "Level" attribute is "Info".

  2. ArchiveAboveSize – the maximum size for archiving files 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 files. 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 a 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 files 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 files. 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 a 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 the elastic index. The default value is "null".

  3. Url – the url to the elastic search server. The default value is https://analytics.cinegy.com/login

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

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

The index file pattern is a 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"/>