<BlockSwitcher>
<Block name="Java">
Add import statement to the `AWSCloudWatchLoggingPlugin`
```java
import com.amplifyframework.logging.cloudwatch.AWSCloudWatchLoggingPlugin;
```

Execute the flush log function from the plugin.

```java
AWSCloudWatchLoggingPlugin plugin = (AWSCloudWatchLoggingPlugin)Amplify.Logging.getPlugin("awsCloudWatchLoggingPlugin");
plugin.flushLogs(
    () -> {
        // logs flushed successfully
    }, error -> {
        // failed to flush logs
    }
);
```
</Block>
<Block name="Kotlin">

Add import statement to the `AWSCloudWatchLoggingPlugin`
```kotlin
import com.amplifyframework.logging.cloudwatch.AWSCloudWatchLoggingPlugin
```

Execute the flush log function from the plugin.

```kotlin
val plugin = Amplify.Logging.getPlugin("awsCloudWatchLoggingPlugin") as? AWSCloudWatchLoggingPlugin
plugin?.flushLogs(
    {
        // logs flushed successfully
    },{  error ->
        // failed to flush logs
    }
);
```

</Block>
<Block name="RxJava">

Add import statement to the `AWSCloudWatchLoggingPlugin`
```java
import com.amplifyframework.logging.cloudwatch.AWSCloudWatchLoggingPlugin;
```

Execute the flush log function from the plugin.

```java
AWSCloudWatchLoggingPlugin plugin = (AWSCloudWatchLoggingPlugin)Amplify.Logging.getPlugin("awsCloudWatchLoggingPlugin");
plugin.flushLogs(
    () -> {
        // logs flushed successfully
    }, error -> {
        // failed to flush logs
    }
);
```

</Block>
</BlockSwitcher>
