Board index FlightGear Support Interfacing

Help with logging

Connecting two computers, using generic protocol, connecting with Matlab?

Help with logging

Postby Zequinha » Sat Jan 25, 2020 1:30 am

Hi folks,

I am trying to follow the logging procedure described in

https://www.youtube.com/watch?v=HSCp5WfFMo4&t=1s

However, when i click "debug -> logging -> enable logging" FlightGear crashes in versions 2019.1.1 and apparently also on 2018.3.2.

The procedure to enable logging, as described in the video, used to work at least up to version 2017.2.1.

Why is the "enable logging" not working?


Thanks!
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: Help with logging

Postby wkitty42 » Sat Jan 25, 2020 5:01 pm

the file writing security was adjusted back in 2017.3.1 to avoid CVE-2017-13709...
Re: [Flightgear-devel] custom logging output file / fix for CVE-2017-13709
CVE-2017-13709 Detail

i think you can tell FG that certain directories are allowed to be written to but i'm unable to easily find this information in the wiki and my google-fu seems to be off this morning :(

when i attempt the same as you describe, i see the following logged in the console and in the fgfs.log file...

Code: Select all
   55.96 [ALRT]:general    The FGLogger logging system, via the '/logging/log/filename' property, was asked to write to 'fg_log.csv', however this path is not authorized for writing anymore for security reasons. Please choose another location, for instance in the $FG_HOME/Export folder (/home/myuser/.fgfs/Export).


the segmentation fault happens afterward when a shutdown appears to be automatically triggered... i have backtraces for the crashing scenario and will forward them to the mailing list for analysis and remediation... [Flightgear-devel] SIGSEGV when attempting to use F10->Debug->Logging with unwritable output path

if i specify a proper and writable path to the output file as given in the error output (/home/myuser/.fgfs/Export/fg_log.csv), there is no problem, no crash, and a proper csv file is written in the specified directory... i did try using "$FG_HOME/Export/fg_log.csv" but the $FG_HOME macro is not expanded and the defect is triggered as well...

for now, the easiest thing to do is to specify a proper path that FG can write the desired output file to...

thanks for the report!

[edited to add link to the dev mailing list thread]
[edited to add link to CVE-2017-13709 Detail]
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Help with logging

Postby Zequinha » Sat Jan 25, 2020 11:29 pm

Thanks wkitty42!

How do you specify a valid and writeable path? Is that in the Qt launcher?
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: Help with logging

Postby wkitty42 » Sun Jan 26, 2020 12:22 am

you simply write it in the field provided at the top of the form... by default it contains only "fg_log.csv" so you edit the field to put in the path to your $FG_HOME/Export directory with the file name...

eg: /home/myuser/.fgfs/Export/fg_log.csv

the above is for linux which uses ~/.fgfs for $FG_HOME... check the wiki for the location on windows or mac...
Last edited by wkitty42 on Fri Jul 07, 2023 5:42 pm, edited 1 time in total.
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Help with logging

Postby Zequinha » Sun Dec 06, 2020 1:01 am

Thanks that works on version 2020.3.2 !

However I have to manually write ´/home/myuser/.fgfs/Export/fg_log.csv´, every time i want to log data. The copy paste does not seem to work.

I wonder if the path ´/home/myuser/.fgfs/Export´ could be automatically coded, avoiding the segfault.
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: Help with logging

Postby wkitty42 » Sun Dec 06, 2020 5:07 pm

you can add the following to your startup options...
Code: Select all
--prop:/logging/log[0]/filename=/home/myuser/.fgfs/Export/fg_log.cvs


AFAIK, it cannot be done in the defaults.xml file unless FG has a way to read environment variables and get their contents... we used to use something like "$[HOME_DIR]/blah/foo" where the environment variable (aka envar) HOME_DIR contains the current user's home directory path... other envars could also be used... they are set before the application runs... and a query of a non-existent one would simply return an empty string... i don't know of anything like this in FG or many of today's programs...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Help with logging

Postby Zequinha » Mon Dec 07, 2020 11:38 am

Thanks!

Is there a way of starting FlightGear from the terminal using that option, something like:

fgfs --launcher --prop:/logging/log[0]/filename=/home/myuser/.fgfs/Export/fg_log.cvs

?

EDIT: the option is memorized by the Qt laucher, so that is good enough for me!
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: Help with logging

Postby wkitty42 » Mon Dec 07, 2020 1:40 pm

yes... the additional options section of the launcher is exactly like the command line... just one option per line, though...

the format is exactly the same whether using command line, .rc file, --config file, and additional options box in the launcher... yes, that's four different methods available to do the same thing... i use a combination of three of them every time i run FG ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Help with logging

Postby S&J » Mon Dec 07, 2020 9:15 pm

What exactly does a lot file show ?

Properties ?
"Stay away from negative people.They have a problem for every solution." - Albert Einstein
S&J
 
Posts: 794
Joined: Wed Aug 26, 2020 7:31 pm

Re: Help with logging

Postby Zequinha » Mon Dec 07, 2020 11:01 pm

Thanks wkitty42!

S&J, here is why i want the log file: https://gitlab.com/CrazyBaboon/mapgear.

In my case i log the latitude, longitude and altitude of all my flights!
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: Help with logging

Postby S&J » Tue Dec 08, 2020 12:23 am

What flight model do the planes you fly use ?

jsbsim will log data of your choosing for you if you want
"Stay away from negative people.They have a problem for every solution." - Albert Einstein
S&J
 
Posts: 794
Joined: Wed Aug 26, 2020 7:31 pm

Re: Help with logging

Postby Zequinha » Tue Dec 08, 2020 12:46 pm

S & J what do you mean by flight model?

Is jsbsim easier than the FGFS inbuilt logger?
Zequinha
 
Posts: 204
Joined: Sun Mar 13, 2016 5:26 pm
OS: GNU

Re: Help with logging

Postby S&J » Tue Dec 08, 2020 3:14 pm

A flight model is that thing that makes it fly like a plane. In FG I believe there are 2 main types of flight models yasim and jsbsim.

If the plane you're flying is a jsbsim version, then with a couple of extra lines added to the bottom of the xml file you could log whatever property you wanted using whatever time spacing you wanted.
I fly helicopters and using the jsbsim huey I've been able to log the flight as the code is already there just needed to uncomment it and modify the xml file to say which properties I wanted.

I've never us FG's logger, didn't know it existed, so wouldn't know if it's easier or not.
"Stay away from negative people.They have a problem for every solution." - Albert Einstein
S&J
 
Posts: 794
Joined: Wed Aug 26, 2020 7:31 pm

Re: Help with logging

Postby Johan G » Tue Dec 08, 2020 11:03 pm

See also the FlightGear wiki article Logging properties (permalink).

In the Related content section there is also links to articles about other ways to log properties, some of them mentioned above. :wink:
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests