Logging and Troubleshooting

The Group Chat API provides built in logging capabilities. Basic information about messages and events that are processed by the Group Chat API are published to a log file. If present, the Group Chat API will use a customized logging configuration. The log configuration loads according to the following rules:

  1. The app.config file (or the Web.config file in case of a web application) for your program

    Check for a <log4mgc> configuration section

  2. A standalone app.Log.config file

    Check the executable directory of your program for file with the specified naming convention, containing an XML document which describes the <log4mgc> configuration.

  3. If no configuration is found

    Logging is written to %userprofile%\tracing\app.log using the default values.

  4. For logging in a web application, the path to the configuration file is specified when the GroupChatEndpoint is instantiated.

The following XML example shows Group Chat API logging values.

<?xml version="1.0" encoding="utf-8" ?>
<log4mgc>
  <file value="ApplicationName.log" />
  <maximumFileSize value="20" />
  <!-- in MB, 2047 max-->
  <maxSizeRollBackups value="10" />
  <filemode value="append"/>
  <level value="ALL" />
</log4mgc>

The following table describes how Group Chat logging is customized.

Value

Description

<maximumFileSize>

Size in MB of log file before a rolling backup is created, and a new log file is opened.

Recommended value: 20

<maxSizeRollBackups>

Number of rolling backup files to keep.

Recommended value: 10

<filemode>

A System.IO.FileMode value which defines how log files should be opened.

Recommended value: append

<level>

A log level which is one of the following (in decreasing order of verbosity)ALL, DEV, TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL, FATAL, SYSTEM, NONE

Recommended value: INFO.

When ALL is specified, the specified log file will be created in the “%userprofile%\tracing” directory.

When the value is to NONE, no logging is recorded, but a zero-length logging file of the specified name will be created.

To disable logging without creating a logging file, add an <AppSettings> element to the app.config or web.config file, as follows:

<AppSettings>
   <add key=”DisableLogging” value=”true”/>
</AppsSettings>

An application must be restarted for the new setting to take place.

Show: