Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Znav
nextLogger Plug-ins
prevCustom Loggers

Ice provides a file-based logger as well as Unix- and Windows-specific logger implementations. For .NET, the default Ice logger uses a TraceListener and so can be customized at run time via configuration.

On this page:

Table of Contents
maxLevel3

File Logger

The file-based logger is enabled via the Ice.LogFile property. This logger is available for all supported languages and platforms.

Syslog Logger

You can activate a logger that logs via the Unix syslog implementation by setting the Ice.UseSyslog property. This logger is available in Ice for C++, Java, and C#, as well as for scripting languages based on Ice for C++.

Ztop

Windows Logger

On Windows, subclasses of Ice::Service use the Windows application event log by default. The event log implementation is available for C++ applications.

Ztop

.NET Logger

The default logger in Ice for .NET writes its messages using the System.Diagnostics.Trace facility. By default, the Ice run time registers a ConsoleTraceListener that writes to stderr. You can disable the logging of messages via this trace listener by setting the property Ice.ConsoleListener to zero.

You can change the trace listener for your application via the application's configuration file. For example:

Wiki Markup
{zcode}
<configuration>
  <system.diagnostics>
    <trace autoflush="false" indentsize="4">
      <listeners>
        <add name="myListener"
          type="System.Diagnostics.EventLogTraceListener"
          initializeData="TraceListenerLog" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>
{zcode}

This configuration installs a trace listener that logs to the Windows event log using the source name TraceListenerLog.

Note

The EventLogTraceListener creates a new event source if no match is found for the source name defined by initializeData, and creating a new event source requires that you run the application with administrative privileges. Alternatively, you can create the event source in advance using an administrative tool. For more information, search MSDN for "EventLog Component".

Ztop

See Also

Zret
Znav
nextLogger Plug-ins
prevCustom Loggers