flutter_logs_firebase_timber 0.0.5
flutter_logs_firebase_timber: ^0.0.5 copied to clipboard
FlutterLogsFirebaseTimber is a logging package for Flutter, similar to Android's Timber.
FlutterLogsFirebaseTimber is a logging package for Flutter, similar to Android's Timber. This package allows you to track logs both locally and remotely using Firebase Realtime Database.
Features #
- Track logs remotely and locally.
- Monitor application logs in the Firebase console.
- Easy to use.
- Realtime database screenshot:

Getting started #
- Add the package to your pubspec.yaml file:
flutter_logs_firebase_timber: ^0.0.3
- Run the command to fetch all the dependencies listed in your pubspec.yaml file and makes them available in your project.
flutter pub get
Firebase Setup #
- Create a Firebase project in the Firebase console.
- Register your app by clicking the Flutter icon in the Project Overview section.

- Follow the given instructions for CLI setup.
A. Configure Firebase Realtime Database rules for public read and write access: #
- Select your Firebase project.
- Navigate to Realtime Database:
- Click on "Build" in the left-hand menu, then select "Realtime Database".
- Open the Rules Tab:
- Click on the "Rules" tab in the Realtime Database section.
- Set Public Read and Write Access:
- Replace the existing rules with the following code to allow public read and write access. Note that setting public access is generally not recommended for production applications due to security risks. Use this configuration only for testing or development purposes.
{
"rules": {
".read": "true",
".write": "true"
}
}
- Click the "Publish" button to apply the changes.
Important Note: #
- Setting .read and .write to true allows anyone with the database URL to read and write data, posing significant security risks. For production environments, implement proper security rules to protect your data. For example, allow access only to authenticated users:
{
"rules": {
".read": "auth != null",
".write": "auth != null"
}
}
Example #
Initializes the FlutterLogsFirebaseTimber package.This method should be called once during the application startup.
await RemoteLogger.initialize();
- To perform asynchronous operations before the runApp() method is called, such as initializing a database or fetching initial configuration settings, you should ensures that the binding between the Flutter framework and the underlying platform (such as iOS or Android) is fully initialized at the beginning of the main() function.
WidgetsFlutterBinding.ensureInitialized();
- Asynchronously initializes for RemoteLogger.
void main() async {
// Ensure that the Flutter framework is initialized
WidgetsFlutterBinding.ensureInitialized();
//Initialze the package only for debug mode
if (kDebugMode) {
await RemoteLogger.initialize();
}
runApp(const MyApp());
}
Usage #
This is a static method call to the log function of the RemoteLogger class providing functionality to send log messages to a logging service on Firebase.
RemoteLogger.log(
logLevel: LogLevel.info,
tag: "onPressed()",
message: "This is a log message",
error: null)
Additional information #
We hope you find FlutterLogsFirebaseTimber useful!