Logbook Add-on

From FlightGear wiki
Jump to navigation Jump to search
Logbook Add-on
Logbook add-on with main logbook window and secondary with details of single entry, with "dark" theme.
Logbook add-on with main logbook window and secondary with details of single entry, with "dark" theme.
Developed by Roman Ludwicki (PlayeRom, SP-ROM)
Initial release December 11th, 2022
Latest release 1.5.1, February 27th, 2024
Written in Nasal
Development status Advanced production
Type Addon
License GNU General Public License v3

Logbook is a FlightGear add-on for automatically logbook all your flights to CSV file. The add-on also provides a Canvas graphical interface for viewing, editing the logbook and showing total statistics.

How it's working?

The add-on tries to automatically detect if an aircraft has taken off by checking the Weight on Wheels. Then the add-on starts collecting information about the flight. This means that if you are parked, taxiing, etc., it is not yet included in the flight log. If you are in the air, the add-on tries to detect if you have landed also by testing Weight on Wheels. Thus, logging takes place from the moment the aircraft is lifted off the ground until it is put back on the ground.

If the aircraft has no wheels, only the floats, then the add-on will also try to recognize if the floats are resisting the water (if the aircraft uses JSBSim), thus recognizing whether you are in the air or not.

The add-on also recognizes the moment of launch of the Space Shuttle from the starting position, which required a separate consideration due to the different launch.

Logbook file

You will find the CSV file in the directory $FG_HOME/Export/Addons/org.flightgear.addons.logbook/logbook-v{file version}.csv, where $FG_HOME on Windows is:

C:\Users\{user name}\AppData\Roaming\flightgear.org\

and on Linux/MacOS:

/home/{user name}/.fgfs/

You can always open it and edit by any Spreadsheet program like LibreOffice Calc, MS Excel, etc. However please don't put the characters , in the cells, because the Logbook parser will recognize them as a column separator, which will cause errors in the operation of the add-on. It is safer to edit the log data through the GUI in the simulator.

Logbook file structure

The following information is logged into the file:

  1. Date – aircraft take-off date. This is the date taken from your OS, not the date in the simulator. I decided I'd know when I flew in my own time zone, in front of my own computer, rather than what the UTC or local time was in the simulation, which would not be valuable. If you have a different opinion and reasonable arguments, let me know.
  2. Time – aircraft take-off time. As with Date this is the time taken from the OS.
  3. Aircraft – the code name of the aircraft.
  4. Variant – the code name of the aircraft as its variant. Some aircraft are available in several variants, such as the default "Cessna 172P", which includes different variants like "Cessna 172P Float". If you select "Cessna 172P," you will see c172p in the Aircraft as well as Variant column. If you select the float variant ("Cessna 172P Float"), you will see c172p in the Aircraft column, but c172p-float in the Variant column. This way you have the main group of aircraft in the Aircraft column, and its variants in the Variant column. This will allow you to extract Totals statistics for a general group of aircraft no matter what variant (filtering by Aircraft), as well as more precisely for a specific variant of a given aircraft (filtering by Variant).
  5. Type – aircraft type as one of following values:
    • "heli" (helicopter),
    • "balloon" (also airship),
    • "space" (space ship),
    • "seaplane" (also amphibious),
    • "military",
    • "glider",
    • "turboprop",
    • "bizjet",
    • "airliner",
    • "ga-single" (small piston single-engine general aviation),
    • "ga-multi" (small piston multi-engine general aviation),
    • "others" (undefined or not recognized).
  6. Callsign – your callsign set for multiplayer.
  7. From – the ICAO code of the airport from which you have taken off. If you are starting immediately in the air, this field will remain blank.
  8. To – the ICAO code of the airport where you landed. If you did not land (e.g. by closing FG in flight) or by landing at an adventurous location, this field will remain blank.
  9. Landing – if you landed anywhere, a 1 will be entered here. If the flight ended without landing or the add-on was unable to detect a valid landing, this field will be left blank.
  10. Crash – if the add-on recognizes an aircraft crash, a 1 will be entered here, otherwise this field will be left blank.
  11. Day – the number of hours spent flying during the day.
  12. Night – number of hours spent flying during the night.
  13. Instrument – the number of hours flown during the IMC (Instrument Meteorological Conditions).
  14. Multiplayer – the number of flight hours when connecting to a multiplayer server.
  15. Swift – number of flight hours when connecting to swift.
  16. Duration – total duration of the flight in hours, as the sum of Day and Night. The Instrument is not added up here, as it is simply counted separately, regardless of whether it was day or night. Duration is calculated in real time, so if you speed up or slow down the simulation time, it will not be affected.
  17. Distance – total distance flown from take-off to landing, in nautical miles.
  18. Fuel – total amount of fuel burned in flight, in U.S. gallons.
  19. Max Alt – maximum altitude, in feet, reached during flight.
  20. Note – notes, by default the full name of the aircraft. This is a good place to enter your own notes as well.

Viewing the logbook

The add-on also provides the ability to view the entire flight logbook from the simulator. You should select "Logbook" -> "Logbook" from the menu. The main window will open with the entire logbook in tabular form. The last row signed "Totals", contains a summary, not only of the visible entries on a given page, but of the entire logbook. The same "Totals" row is visible on every page. The exception for totals is the Max Alt column, in which we do not have the sum of all altitudes, but the highest one.

At the very bottom we have a row of buttons, mainly for moving through the log pages. The [|<<] button means moving to the first page, [<] moving to the previous page, [>] moving to the next page, [>>|] moving to the last page. In the middle we have text information in the format {on which page we are} / {number of all pages} (number of entries in the log). On the right we have a [dark]/[light] button to switch between window styles. The [?] button opens a window with help (the same as from the "Logbook" -> "Help" menu).

Each log entry can be hovered over and clicked. Then an additional window will open presenting the details of the given entry. In general, we have the same information here as in the main window, except:

  1. ICAO airport codes include their names in parentheses.
  2. With numerical data, you are given the units in which these values are presented with conversions to other units.
  3. At the very bottom you have an additional Note field, which is not displayed in the main window, due to the possibility of placing any length of text here.

Data filtering

The add-on allows you to filter some columns in the main log window. At the moment you can filter by the "Date" (as a year), "Aircraft", "Variant", "Type", "Callsign", "From", "To", "Landing" and "Crash" columns. To use filtering, hover the mouse cursor over a column name (it will be highlighted) and click it. A new window will appear with a choice of values. For filtering on the "Aircraft" column, these will be the IDs of aircraft you have flown before. For filtering by the "Type" column, these will be the names of aircraft types, etc. Each window with filters also has the "Default All" position, which means that the filter will be turned off and all items will be shown. When the filter is enabled, a (!) sign will be shown next to the filtered column to warn that the filter has been used.

After using the filter, the "Totals" row will also be updated with the filtered data. In this way, you can see statistics for a specific aircraft or types of aircraft.

Editing and deleting data

Editing one of the fields with "Light" theme

Each logbook entry can be edited from the simulator. You need to select "Logbook" -> "Logbook" from the menu. The main window with the entire logbook will open. Here you can search for the entry you want to edit and click on it. The details window for the entry will open. Now you can click on the specific entry you want to edit. Another window with a text field will open. Just enter the new value and confirm with the [Save] button. The change will immediately be saved to a CSV file.

At the bottom of the details window there is a [Delete] button, with which you can completely delete the selected entry.


Before each saving of a single change, the add-on creates a copy of the original CSV file, to which it appends the .bak extension at the end. So, if something goes wrong while editing the data and the original file is corrupted, you can always recover it by removing the .bak from the copy name. Remember, you only have a copy of one recent file operation.

Recovery mode

This add-on includes a mechanism to save the current flight status to a separate file recovery.csv every minute. If FlightGear unexpectedly closes due to an error, this file will be read on reboot and an entry from this file will be moved to the main log file. In this way, no flight, even aborted, should be lost.


  1. If you properly close the simulator during the flight ("File" -> "Exit"), the current flight status will be saved to the logbook (without landing information, of course).
  2. If the simulator will be closed incorrectly during flight, e.g. via the [X] button on the window bar, or a crash occurs, the logbook data should be saved in the recovery.csv file. The data in the recovery.csv file will be automatically transferred to the logbook.csv file when the simulator is restarted.
  3. To count as a landing, the aircraft must rest on all wheels and maintain this state for at least 3 seconds. In this way, an ugly bounce off the runway will not be counted as a landing.
  4. If you start a simulation in the air, the add-on will recognize this and start logging without waiting for take-off.
  5. If you start a simulation in the air, the add-on is unable to recognize the landing gear, so the landing detection pass will extend to 6 seconds (giving an extra 3 seconds to make sure the aircraft is resting on all wheels).
  6. Helicopters should also be supported, although I have not tested all of them.
  7. The add-on supports JSBSim-based watercraft, although I have not tested all of them.
  8. The add-on supports the Space Shuttle.
  9. Flights with UFO will not be logged.
  10. Pausing the simulation or turning on the replay mode stops the flight statistics from being added to the log.
  11. As for fuel burn, the add-on does not take in-flight refueling into account. If you change the amount of fuel during the flight, the result in the Fuel column will be incorrect. So try to avoid it and refuel the aircraft before the flight.
  12. Supported FG versions from 2020.1.
  13. The minimum resolution for using the GUI is 1366x768.

Landing gear hints

If this add-on has a problem with recognizing the landing gear correctly, then you can put the appropriate properties to indicate which indexes from /gear/gear[index] are used by the aircraft.

The structure of the property to be passed to FlightGear is as follows:

                   <landing-gear-idx type="int">12</landing-gear-idx>
                   <landing-gear-idx type="int">13</landing-gear-idx>

Each <landing-gear-idx> tag should contain an integer indicating the index of the /gear/gear property array. Thus, <landing-gear-idx> with values of 12 and 13, indicate that the aircraft uses /gear/gear[12] and /gear/gear[13].

These properties can be added in a number of ways, such as by placing them in the aircraft files, or by using command line options:


Thanks to MariuszXC for this feature.