Skip to content
perpetualKid edited this page Jan 8, 2025 · 6 revisions

Logging

When the Logging option in the main window is checked, a log file is generated. This log file contains rich information about the execution of the game session, allowing identification of critical problems and investigattion of malfunctions.

This is very helpful for application developers to understand and address problems with the software. Also warnings and information of missing or unexpected content, i.e. in signal script issues, or shape and texture problems, are reported in the log file.

The messages of the file are often self-explanatory, and therefore can be evaluated also by contents developer. It includes reports of various errors in the MSTS files which are ignored by OR, including missing sound files, unrecognized terms in some files, etc.

When selected in Main Menu -> Options "Show shape warnings", the Train Simulator will report errors found in shape files in the log file. It includes also reports about malfunctions in the gaming session, such as trains passing red signals, as well as OR malfunctions.

If you experience any issues, make sure that Logging is enabled, and check the log file for any clues to the problem.

When requesting support, the log file should always be attached.

At every restart of the game (that is, after clicking "Start" or multi-player "Server" or "Client"), an existing file with the same name is cleared and a new one is generated.

During loading, if logging is selected, the log file will already begin storing data.

Location

Starting with FreeTrainSimulator version 2.0.0 and newer, log files are no longer placed on the user desktop, but in the user's application data folder (typically C:\Users\USERNAME\AppData\Roaming\Free Train Simulator\Logs).
For easier access to this folder, the new menu application toolbar has a button right next to the new Profiles section, to browse the Windows Explorer to the Logs folder.

Profiles Header in Menu application

Customization

The file name for the log file can be customized. This is not exposed in the user interface (Main Menu), but can be edited directly in the settings store (registry or file).

The standard log file name is either the product name (see below) or includes the actual application name (see below) for secondary applications like Toolbox.

The following tokens are available to customize the log file name:

{application} returns the full application name, such as "Open Rails Toolbox"

{product} returns the product name, "Open Rails Ultimate"

{version} returns the current version number, such as "1.3.6-RC.1"

{date} returns the current date in local format, such as "2021/03/15"

{time} returns the current time, such as "10:34:42"

When customizing, set the filename to the desired pattern, i.e.

LogFilename = "{product} {date}-{time}.txt"

In this case, the logfile name will be like

    "Free Train Simulator 2024/03/15-10:34:42.txt"

Any characters which are invalid for file names, will be replaced by an underscore _, so in above case, the final log file name will become

    "Free Train Simulator 2024_03_15-10_34_42.txt"

When using variables such as date, time and version in the filename pattern, this will generate a new file every time the logging starts. While this is a great option to have log files from multiple runs available (i.e. for comparison), it will be the users responsibility to cleanup older files which are no longer needed.

Clone this wiki locally