<BlockSwitcher>
<Block name="Java">

```java
Amplify.Hub.subscribe(HubChannel.LOGGING,
            hubEvent -> {
                if (hubEvent.getName().equals(LoggingEventName.WRITE_LOG_FAILURE.toString())) {
                    Log.i("LOGGING", "Failed to write logs");
                } else if (hubEvent.getName().equals(LoggingEventName.FLUSH_LOG_FAILURE.toString())){
                    Log.i("LOGGING", "Failed to flush logs");
                }
            }
        );
```

</Block>
<Block name="Kotlin">

```kotlin
Amplify.Hub.subscribe(
    HubChannel.LOGGING
) { hubEvent: HubEvent<*> ->
    if (hubEvent.name == LoggingEventName.WRITE_LOG_FAILURE.toString()) {
        Log.i("LOGGING", "Failed to write logs")
    } else if (hubEvent.name == LoggingEventName.FLUSH_LOG_FAILURE.toString()) {
        Log.i("LOGGING", "Failed to flush logs")
    }
}
```

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

```java
RxAmplify.Hub.on(HubChannel.LOGGING)
.map(HubEvent::getName)
.subscribe(name -> {
    if (name.equals(LoggingEventName.WRITE_LOG_FAILURE.toString())) {
        Log.i("LOGGING", "Failed to write logs");
        return;
    } else if (name.equals(LoggingEventName.FLUSH_LOG_FAILURE.toString())) {
        Log.i("LOGGING", "Failed to flush logs");
        return;
    }
});
```
</Block>
</BlockSwitcher>
