@@ -111,6 +111,48 @@ On HTML5 exports, ``user://`` will refer to a virtual filesystem stored on the
111
111
device via IndexedDB. (Interaction with the main filesystem can still be performed
112
112
through the :ref: `JavaScriptBridge <class_JavaScriptBridge >` singleton.)
113
113
114
+ File logging
115
+ ------------
116
+
117
+ By default, Godot writes log files in ``user://logs/godot.log `` on desktop
118
+ platforms. You can change this location by modifying the
119
+ ``debug/file_logging/log_path `` project setting. Logs are rotated to keep older
120
+ files available for inspection. Each session creates a new log file, with the
121
+ old file renamed to contain the date at which it was rotated. Up to 5 log files
122
+ are kept by default, which can be adjusted using the
123
+ ``debug/file_logging/max_log_files `` project setting.
124
+
125
+ File logging can also be disabled completely using the
126
+ ``debug/file_logging/enable_file_logging `` project setting.
127
+
128
+ When the project crashes, crash logs are written to the same file as the log
129
+ file. The crash log will only contain an usable backtrace if the binary that was
130
+ run contains debugging symbols, or if it can find a debug symbols file that
131
+ matches the binary. Official binaries don't provide debugging symbols, so this
132
+ requires a custom build to work. See
133
+ :ref: `Debugging symbols <doc_introduction_to_the_buildsystem_debugging_symbols >`.
134
+ for guidance on compiling binaries with debugging symbols enabled.
135
+
136
+ .. note ::
137
+
138
+ Log files for :ref: `print<class_@GlobalScope_method_print> `
139
+ statements are updated when standard output is *flushed * by the engine.
140
+ Standard output is flushed on every print in debug builds only. In projects that
141
+ are exported in release mode, standard output is only flushed when the project exits
142
+ or crashes to improve performance, especially if the project is often printing
143
+ text to standard output.
144
+
145
+ On the other hand, the standard error stream
146
+ (used by :ref: `printerr<class_@GlobalScope_method_printerr> `,
147
+ :ref: `push_error<class_@GlobalScope_method_push_error> ` and
148
+ :ref: `push_warning<class_@GlobalScope_method_push_warning> `) is always
149
+ flushed on every print, even in projects exported in release mode.
150
+
151
+ For some use cases like dedicated servers, it can be preferred to have release
152
+ builds always flush stdout on print, so that logging services like journald can
153
+ collect logs while the process is running. This can be done by enabling
154
+ ``application/run/flush_stdout_on_print `` in the Project Settings.
155
+
114
156
Converting paths to absolute paths or "local" paths
115
157
---------------------------------------------------
116
158
0 commit comments