> For the complete documentation index, see [llms.txt](https://vostok.gitbook.io/logging/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vostok.gitbook.io/logging/how-to-guides/combining-multiple-logs.md).

# Combining multiple logs

**Prerequisites**: install [abstractions module](/logging/modules/abstractions.md).

Multiple `ILog` instances can be combined with `CompositeLog`:

```csharp
var consoleLog = new ConsoleLog();
var fileLog = new FileLog(new FileLogSettings());
var combinedLog = new CompositeLog(consoleLog, fileLog);
```

`CompositeLog` forwards incoming log events to all underlying logs.

Its `IsEnabled(LogEvent)` method returns true if any of the underlying logs is enabled for given event.&#x20;

Its `ForContext(string)` method invokes `ForContext` on all underlying logs and returns a new `CompositeLog` based on the results.
