> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WriteToLog

> Call WriteToLog in the ABBYY FlexiCapture API to record a set of LogRecord events in the Application Server log, with client time for accurate timestamps.

Writes event data into the log on the Application Server.

## Definition

```csharp theme={null}
void WriteToLog(long clientTime, LogRecord[] records);
```

## Parameters

| Name | Type | Description |
| - | - | - |
| `clientTime` | `long` | The date and time when the event occurred on the workstation, as a FILETIME value. To convert the value, use the conversion example after this table. |
| `records` | [LogRecord](/flexi-capture/api/structures/log-record)\[] | A set of records, each describing one event to write to the log on the Application Server. |

Convert `clientTime` between `long` and `DateTime` in C# as follows:

```csharp theme={null}
DateTime dTime;
long lTime;
...
// conversion from long to DateTime
dTime = DateTime.FromFileTime(lTime);
...
// conversion from DateTime to long
lTime = dTime.ToFileTime();
```

## Why both time parameters are needed

Provide both the `clientTime` parameter and the `LogRecord.time` value so that events are timestamped accurately. Two conditions make both values necessary:

* The `WriteToLog` call can be deferred.
* Local time on the client computer and the time on the server can differ. If you know the local time on the client computer when `WriteToLog` was called, this difference can be corrected.

## Returned value

None.
