# MTLogger

The Logger allows for the logging of messages to the MetraTech log file and the Windows NT Event Log.

## Program ID

MTLogger.MTLogger.1

## MTLogger Methods

Init | The Init method initializes the Logger with the logging.xml file in the specified relative configuration path and the application tag.
LogEvent | The LogEvent method logs the specified message to the Windows NT event log.
LogThis | The LogThis method logs the specified message to the MetraTech log file if the log level is set to the appropriate level.

## Example

Example to be provided in a future release of this online help system.

# Method Detail

## Init

The Init method initializes the Logger with the logging.xml file in the specified relative configuration path and the application tag.

If a logging.xml file is not present in the relative configuration path, the default logging.xml file (in Logging) is used. The application tag is the tag that is written at the beginning of the log messages in the MetraTech Log.

### Visual Basic Syntax

Sub Init(apConfigPath As String, apAppTag As String)

### C++ Syntax

HRESULT Init([in] BSTRapConfigPath, [in] BSTR apAppTag);

### Arguments

apConfigPath

The relative configuration path to the logging.xml file.

apAppTag

The tag that precedes logged error messages.

## LogEvent

The LogEvent method logs the specified message to the Windows NT event log.

### Visual Basic Syntax

Sub LogEvent(apData As String)

### C++ Syntax

HRESULT LogEvent([in] BSTR apData);

### Arguments

apData

The data to log to the Windows NT event log.

## LogThis

The LogThis method logs the specified message to the MetraTech log file, if the log level is set to the appropriate level.

### Visual Basic Syntax

Sub LogThis(aLogLevel As MTLogLevel, apData As String)

### C++ Syntax

HRESULT LogThis([in] MTLogLevel aLogLevel, [in] BSTR apData);

### Arguments

aLogLevel

The log level at which the messages will be logged.

apData

The data to be logged.