• Programming Guide
  • Api Documentation
  • OnixS CME iLink3 Handler for .NET Core, version 1.4.2
Show / Hide Table of Contents
  • Introduction
  • System Requirements
  • Getting Started
    • Error Reporting
    • Licensing
    • SBE Message
      • Tag-based Messaging
      • Message Fields
      • Repeating Groups
    • iLink 3 Session
      • Universally Unique Identifier
      • Establishing iLink3 Connection
      • Exchanging Messages
      • Message Sequence Numbers
  • Configuring the Handler
    • Configuration File Examples (XML or JSON)
  • Logging
  • Session Storage
    • File-Based Session Storage
    • Memory-based Session Storage
    • Asynchronous File-Based Session Storage
    • Pluggable Session Storage
  • Advanced Programming
    • Thread Safety
    • Session Initialization and Binding
    • Session States
    • Listening to Session Events
    • Handling NotApplied Messages
    • Handling Business Reject Messages
    • Automated Downloading of GTC and GTD Orders
    • Reconnection
    • Fault Tolerance
    • Understanding Send Latency
    • Strongly Typed Messages
  • Best Practices
    • Low Latency Best Practices
  • Glossary
  • Support

Logging

This section explains how logging services are organized in the OnixS .NET Core CME iLink 3 Binary Order Entry Handler.

NLog logging

The NLog library is used for Handler-level logging.

NLog could be configured either through a configuration file or programmatically.

NLog shutdown

NLog will, by default, attempt to flush automatically at application shutdown. Microsoft Windows give .NET applications a limited amount of time to perform shutdown (usually 2 sec) before being terminated. If having an NLog configuration with NLog Targets that requires network-traffic (Http, Mail, TCP), then it is a really good idea to perform a manual Flush/Shutdown independent on running on Linux/Windows.

NLog.LogManager.Shutdown(); // Flush and close down internal threads and timers

.NET applications running on Mono/Linux are required to stop threads/timers before entering the application shutdown phase. Failing to do this will cause unhandled exceptions and segmentation faults, and other unpredictable behavior.

Example

For example (NLog.config):


<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwConfigExceptions="true">

  <targets>
    <target name="logfile" xsi:type="File" fileName="CmeMdHandlerLog.txt" deleteOldFileOnStartup="false" 
            layout="${date:universalTime=true:format=yyyyMMdd-HH\:mm\:ss.ffffff}|${level:uppercase=true}|${logger}|${message}"/>

    <target name="logconsole" xsi:type="Console" />
  </targets>

  <rules>
    <logger name="*" minlevel="Info" writeTo="logconsole" />
    <logger name="*" minlevel="Trace" writeTo="logfile" />
  </rules>
</nlog>


See Also

  • NLog library
In This Article
Back to top Copyright © Onix Solutions.
Generated by DocFX