---
title: clsLogTrace
summary: API reference for clsLogTrace.
status: draft
owner: <owner>
last_reviewed: 2026-07-23
library: SAIF.Framework.Logging
reference_type: package
---

# clsLogTrace

`clsLogTrace` is the method-level trace logging entry point. It is fully obsolete and functionally disabled: its public methods can still be called, but no trace data is ever written to any sink.

## Purpose
- Historically provided method-begin/end/message trace logging; now retained only for backward source compatibility (see [BR-002](../../business-rules.md#br-002-trace-logging-is-opt-in-via-flag-or-command-line-switch-but-functionally-inert)).

## Context
- Namespace: `SAIF.Framework.Logging`
- Assembly/package: `SAIF.BOF.Framework.Logging` (`SAIF.Framework.Logging/SAIF.BOF.Framework.Logging.vbproj`)
- Class is `Serializable` with all Shared (static) members.

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `IsEnabled` | `Shared Property IsEnabled As Boolean` | Shared flag gating whether trace calls attempt to build/dispatch a trace record. |
| `PageOutputEnabled` | `Shared Property PageOutputEnabled As Boolean` | Historically controlled page-level trace output; no longer produces output since the sink is a no-op. |
| `TraceUser` | `Shared Property TraceUser As String` | Configures the specific user allow-listed for trace gating via `UserTraceEnabled`. |
| `UserTraceEnabled` | `Shared ReadOnly Property UserTraceEnabled As Boolean` | Returns `True` when the current user matches `TraceUser`, gating trace calls independent of `IsEnabled`. |
| `MethodBegin` | `<Obsolete("Log Trace No Longer Supported, Please remove")> Shared Sub MethodBegin(...)` | Historically recorded a method-entry trace event; the write path is a no-op. |
| `MethodEnd` | `<Obsolete("Log Trace No Longer Supported, Please remove")> Shared Sub MethodEnd(...)` | Historically recorded a method-exit trace event; the write path is a no-op. |
| `MethodMessage` | `<Obsolete("Log Trace No Longer Supported, Please remove")> Shared Sub MethodMessage(...)` | Historically recorded an arbitrary trace message; the write path is a no-op. |
| `ToFile` | `Shared Sub ToFile()` | Redirects the (inert) trace sink to a local CSV file (throws if `IsWeb`; see [BR-003](../../business-rules.md#br-003-file-based-logging-is-prohibited-in-web-applications)). |
| `ToFile` | `Shared Sub ToFile(fileName As String)` | Same as `ToFile()`, using a caller-supplied file name. |

## Behavioral notes
- `MethodBegin`, `MethodEnd`, and `MethodMessage` are all decorated `<Obsolete("Log Trace No Longer Supported, Please remove")>`.
- When gated on (`IsEnabled Or UserTraceEnabled`), a `TraceInfoStruct` is still built, including reflection-derived calling-method info (`GetCallingMethodInfo`), but the private `WriteMessage` sink is a no-op (`'Removed Logic as tracing should not be used.`) — no data ever reaches the file or web-service sinks regardless of flag state.
- The class still exposes a private `WSWriteMessage` path, but it is never reached because `WriteMessage` returns before dispatching.

## Constraints and usage notes
- Consumers should not rely on this class for any trace output; all public trace methods are obsolete and functionally inert.
- `ToFile()`/`ToFile(fileName)` must not be called from a web application; doing so throws `ApplicationException("Logging to files not valid for web applications.")`.

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with `**` could not be confirmed; treat as unknown until verified.

## Related documentation
- [TraceInfoStruct](TraceInfoStruct.md)

## Sources
- `SAIF.Framework.Logging/clsLogTrace.vb`
- `SAIF.Framework.Logging/TraceInfoStruct.vb`
