Skip to content

Instantly share code, notes, and snippets.

@katowulf
Last active August 18, 2023 03:15
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save katowulf/0475fb7a5907ed757f687aab6ed15878 to your computer and use it in GitHub Desktop.
Save katowulf/0475fb7a5907ed757f687aab6ed15878 to your computer and use it in GitHub Desktop.
Enable debug logging in Firestore in Java, Javascript, or Swift.
/******* Android **********/
// See https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FirebaseFirestore.html#setLoggingEnabled(boolean)
FirebaseFirestore.setLoggingEnabled(true);
/******* Server-side Java **********/
/**
See https://medium.com/@hiranya911/logging-in-java-libraries-for-firebase-and-google-cloud-platform-f8742493b73f
1) Add the slf4j-simple binding to the application classpath
2) Set the -Dorg.slf4j.simpleLogger.defaultLogLevel=debug system property
**/
// https://firebase.google.com/docs/reference/js/firebase.firestore#setloglevel
firebase.firestore.setLogLevel('debug');
// https://firebase.google.com/docs/reference/swift/firebasefirestore/api/reference/Classes/Firestore#enablelogging_
Firestore.enableLogging(true)
# For use in Google App Engine and GCP environments
# See https://medium.com/@hiranya911/logging-in-java-libraries-for-firebase-and-google-cloud-platform-f8742493b73f
.level=INFO
com.google.firebase.level=FINE
java.util.logging.SimpleFormatter.format='%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n'
@paulb777
Copy link

swift version should be

  Firestore.enableLogging(true)

@katowulf
Copy link
Author

👍

@wilhuff
Copy link

wilhuff commented Jun 22, 2020

@katowulf
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment