# FileLogger.Log(LogLevel, EventId, TState, Exception?, Func&lt;TState, Exception?, string&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.filelogger/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.logging.filelogger/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.TestingHost/Logging/FileLogger.cs#L172-L174)

```csharp
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
```

Writes a log entry.

### Parameters

- `logLevel` (`LogLevel`): Entry will be written on this level.
- `eventId` (`EventId`): Id of the event.
- `state` (`TState`): The entry to be written. Can be also an object.
- `exception` (`Exception?`): The exception related to this entry.
- `formatter` (`Func<TState, Exception?, string>`): Function to create a `System.String` message of the `state` and `exception`.
