I have a watcher in my Firebase project that automatically compiles and restarts the emulator whenever I change my code. It's nice except I think because of some race conditions I get a new firestore-debug.log
or asidfhusudf.log
file every time I save my code. How can I disable the log files or at least change the location where they are made?
firestore-debug.log is present in the same folder as firebase.json. You can see it in the directory you ran the command which will have a log of all the requests.
You are using typescript for functions so you can refer to the documentation on how function logs works for Typescript projects :
During firebase deploy, your project's
index.ts
is transpiled toindex.js
, meaning that the Cloud Functions log will output line numbers from the index.js file and not the code you wrote. To make it easier for you to find the corresponding paths and line numbers in index.ts, firebase deploy createsfunctions/lib/index.js.map
. You can use this source map in your preferred IDE or via a node module.
How debug output is stored in the firestore-debug.log is mentioned in the Documentation :
A basic debug function that prints Security Rules language objects, variables and statement results as they are being evaluated by the Security Rules engine.The outputs of debug are written to
firestore-debug.log
. The debug function can only be called inside Rules conditions.debug function blocks are only executed by the Security Rules engine in the Firestore emulator, part of the Firebase Emulator Suite. The debug function has no effect in production.Debug logfile entries are prepended by a string identifying the Rules language data type of the log output (for example, string_value, map_value).Calls to debug can be nested.Currently, the debug feature does not support the concept of logging levels(for example, INFO, WARN, ERROR)
.
You can also refer to the stackoverflow case where Kiana and Daniel have provided a brief explanation on how logs older than 1 month got disabled automatically.
You can see it directly within the Firebase console. When trying to choose the timestamp for the logs, logs older than 1 month are disabled, which means are automatically deleted.
You can refer to the documentation for getting an understanding of how Query language is used to filter logs in the Emulator suite UI.