Board index FlightGear Support Installation Windows

Cannot get custom logging to generate a file  Topic is solved

Installing FlightGear, scenery, aircraft etc. on Windows.

Cannot get custom logging to generate a file

Postby blinkybill66 » Mon Aug 21, 2017 2:11 pm

Hi all,

Am fairly new to the FlightGear project - and totally enthusiastic! Flight sim is running fine in itself and I have been playing around with the different aircraft (love the flying boats!).
Now I was wanting to use the logging to get a deeper insight into what is going on behind the scenes - the only thing is that I cannot get it to generate a file.

So, here is what I see:
- The fgfs.log file gets generated in %APP_DATA%/Roaming/flightgear.org.
- The fgfs.log file also shows the config parameter being picked up - see extract:
>> general:3:G:\Jenkins\workspace\Windows-release\flightgear\src\Main\options.cxx:2441: option:config = log-config.xml

However, no .csv file seems to be generated. I have searched the entire C: drive.
I have also tried using absolute paths for both the xml file and the log output file.
Also tried activating the logging from the flight window menu bar.

I am quite happy to dig myself for this, but any clues would be greatly appreciated!


Further details:
---------------------------------------------
Windows 10 64-bit (French language installation)
ASUS Desktop PC_M32CD_A_F_K20CD_K31CD
Graphics card: Intel(R) HD Graphics 530
FG version 2017.2.1 (installed in French)

Additional settings:
--lat=3
--lon=50
--config=log-config.xml

Contents of log-config.xml: (copied from wiki - modified delimiter only)

<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
<logging>
<log>
<enabled>true<enabled>
<filename>steering.csv</filename>
<interval-ms>1000</interval-ms>
<delimiter>;</delimiter>
<entry>
<enabled>true</enabled>
<title>Rudder</title>
<property>/controls/rudder</property>
</entry>
<entry>
<enabled>true</enabled>
<title>Ailerons</title>
<property>/controls/aileron</property>
</entry>
</log>
</logging>
</PropertyList>
blinkybill66
 
Posts: 5
Joined: Fri Aug 11, 2017 3:46 pm
Callsign: bb66
Version: 2017.2.1
OS: Win 10

Re: Cannot get custom logging to generate a file

Postby blinkybill66 » Mon Aug 21, 2017 7:58 pm

I have tried setting log-level to debug - and I do see additional output being written to the fgfs.log file - so at least that seems to be working.
If there was Something preventing the steering log file from being created, I would expect to see an error message go to this log.
So, I am guessing that there is something wrong with the config xml itself - or it is not being read correctly.
blinkybill66
 
Posts: 5
Joined: Fri Aug 11, 2017 3:46 pm
Callsign: bb66
Version: 2017.2.1
OS: Win 10

Re: Cannot get custom logging to generate a file

Postby wkitty42 » Mon Aug 21, 2017 10:36 pm

with the log set to debug, there should be more info regarding this other output file... especially if there's any problems with it... i don't know this for a fact but it would be expected, IMHO... i'll give it a try with the UFO and see what i might happen to see...

[time passes]

before even getting this posted, i've created the above xml file... i called is steering_log.xml and added it to my command line... after i clicked the "Fly!" button in the built-in launcher appeared, i had a dialog box pop up pointing to line 19, column 6 which is the </logging> line... it said this was a mismatched tag... the actual error is higher in the first "enabled" tag... the closing tag is missing the "/"... here's the (properly formatted) file...
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
  <logging>
    <log>
      <enabled>true</enabled>
      <filename>steering.csv</filename>
      <interval-ms>1000</interval-ms>
      <delimiter>;</delimiter>
      <entry>
        <enabled>true</enabled>
        <title>Rudder</title>
        <property>/controls/rudder</property>
      </entry>
      <entry>
        <enabled>true</enabled>
        <title>Ailerons</title>
        <property>/controls/aileron</property>
      </entry>
    </log>
  </logging>
</PropertyList>


this may not be the only problem, though... i'll find out in a few minutes ;)
"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: 4681
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Cannot get custom logging to generate a file

Postby wkitty42 » Mon Aug 21, 2017 10:50 pm

ok... the file is being created... i find it in my flightgear's bin directory... might be better to specify a complete path instead of maybe trying to write it to a directory you may not have write access to... anyway, with the UFO, i'm seeing time stamps but nothing for the aileron or elevator... this seems to match what i'm seeing in the property browser in the sim, too... those two fields are there but they are just empty strings... however, looking at /controls/flight, i do see numbers fluctuating... remember, though, this is with the UFO which operates a lot differently than real aircraft ;)
"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: 4681
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Cannot get custom logging to generate a file

Postby blinkybill66 » Tue Aug 22, 2017 1:17 pm

@wkitty2 - thanks for digging into this and your helpful pointers!
A bit red-faced about the missing "/" in the closing tag ... will be more careful about this in future.

So, tried fixing this, and have done some further investigation, but I don't think it is getting this far yet.

A couple of observations from looking in the internal property browser, when in flight, from the gui:
- None of the /logging properties are getting changed from default - so, it seems that the config xml is getting ignored on startup
- Also tried a couple of things with the config xml - including trying to set a single property - /logging/log/enable to true
- The /logging properties do change if I make changes from the gui logging dialog ... but no log file gets created, whether I try default, custom name, with/without path
- I can also go in and change any of these properties interactively ... but still no file.

I am guessing it is something to do with French version ("Users" subdir is called "Utilisateurs" - I tried both) or spaces in the path (Windows/Program Files).
I am now reinstalling to D:\fgfs and will see if this helps at all.
blinkybill66
 
Posts: 5
Joined: Fri Aug 11, 2017 3:46 pm
Callsign: bb66
Version: 2017.2.1
OS: Win 10

Re: Cannot get custom logging to generate a file

Postby blinkybill66 » Tue Aug 22, 2017 1:51 pm

Aha! Reinstalling made no difference ... but, it does work if I run from command line with --config=log-config.xml :D :D
So, problem must be related to the gui ...

And I also had to change to /controls/flight to find the aileron and rudder values.
blinkybill66
 
Posts: 5
Joined: Fri Aug 11, 2017 3:46 pm
Callsign: bb66
Version: 2017.2.1
OS: Win 10

Re: Cannot get custom logging to generate a file

Postby wkitty42 » Tue Aug 22, 2017 6:51 pm

i have more info, too... i haven't checked my email, yet, but the filename of the log file is "relative to the current directory"... that means that if your system changes directories to /blah/blerg (for example), that's where the log file will be written... on my system, using scripts built by the dnc* script, they change into the directory where the compiled binaries live... so that's where the log file appears unless we use relative path statements (eg: ../../../../myflightgear/steering_log.csv)... so i have a query into the dev mailing list to try to figure out why an absolute path doesn't work like one would think it should...

also, the xml file doesn't have to be names "config.xml"... i'm using steering_log.xml and yes, you have to do some of these types of things on the FG command line as you found out... the problem isn't so much the ""GUI"" but that the built-in launcher doesn't/can't process some of these types of options...

yep, /control/flight is where i've been recording from... not only the main elevator, rudder and ailerons, but also their trims... but i'm just playing and wanted to see some things in a chart from a spread sheet :)
"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: 4681
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Cannot get custom logging to generate a file

Postby Necolatis » Tue Aug 22, 2017 8:04 pm

I have no problem getting the logging system to work.

I do recommend 2 things though:
- use absolute path in --config=
- use absolute path when specifying the log file.

That's the way it works best for me.
FG might not want to write anywhere though. But it do want to write to c:\Users\<name>\Documents
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1857
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2018.2.2
OS: Windows 10 Pro

Re: Cannot get custom logging to generate a file  

Postby wkitty42 » Tue Aug 22, 2017 10:10 pm

i was just popping back in to say that i've tested all three, plain file name, absolute path with filename and relative path with file name... all three work... my problem with the absolute path was a typo... in my user name, no less! :oops: :lol:

@Necolatis: do you know if there's a <path></path> tag that can be used to tell where to write the file?

eg:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<PropertyList>
  <logging>
    <log>
      <enabled>true</enabled>
      <filename>steering.csv</filename>
      <path>/home/myuser/myflightgear</path>
      blah blah blah
"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: 4681
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Cannot get custom logging to generate a file

Postby Necolatis » Wed Aug 23, 2017 12:17 am

Don't know sorry.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1857
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2018.2.2
OS: Windows 10 Pro

Re: Cannot get custom logging to generate a file

Postby blinkybill66 » Wed Aug 23, 2017 12:26 am

Thanks for all the pointers, guys.
I might do some further playing with the loader - but right now I am just happy that the logging is working. No problem if that means firing up from the command line for the time being.
blinkybill66
 
Posts: 5
Joined: Fri Aug 11, 2017 3:46 pm
Callsign: bb66
Version: 2017.2.1
OS: Win 10


Return to Windows

Who is online

Users browsing this forum: No registered users and 1 guest