# Logging and Debugging The host app exposes a log viewer and a “Share logs” button. ## How logging worksBubbl exposes a `Logger` helper that writes logs to a file. ```kotlin Logger.log("MainActivity", "Manual refresh") ``` ## Sharing logsThe host app shares logs using `FileProvider`. ```kotlin val logFile = Logger.getLogFile() val uri = FileProvider.getUriForFile(this, "${packageName}.fileprovider", logFile) ``` ## Required file_paths.xmlIf you want to share logs, add this file: `app/src/main/res/xml/file_paths.xml` ```xml ``` ## Why Without this file, `FileProvider` cannot generate a shareable URI and will crash. Tip If you do not need log sharing in production, remove the FileProvider and the related permissions.