Cancel
Showing results for 
Search instead for 
Did you mean: 

No system log output when running from NX cmd with run_journal

Creator
Creator

I was running NX with Python journals through PyDev previously, but it was taking too much time to set it up everytime so I changed to using the command prompt for NX. It runs, but it doesn't produce a syslog file like it did before when running NX in display mode. I've tried to force the log keeping but it doesn't seem to have an impact. 

 

I don't have a functioning catch for NXExceptions/Exceptions yet. I could print those, but the syslogs would also be nice. Is that still possible?

 

 

4 REPLIES 4
Highlighted

Re: No system log output when running from NX cmd with run_journal

NX should still create a syslog. You can find the location with theSession.LogFile.FilePath.

 

However in batch mode, I think he deletes the syslog after completion if the program terminates without an error. So if you want to keep it in that case, you could just as the very last thing you do copy the file somewhere safe.

 

If the program terminates with an exception, the logfile should be kept in any case.

Nikolas Losse | Developer | Siemens PG PR R&D TEC
NX12 | CentOS7 | Python

Re: No system log output when running from NX cmd with run_journal

Creator
Creator
It says that NXOpen.LogFile has no such attribute.

Furthermore, so far the journal has caused NX to terminate on its own.

Would it make sense for the logfile to be in a different folder compared to the logfile location for running in Display?

Re: No system log output when running from NX cmd with run_journal

It's part of the session class, so you need to do (Python example)

 

theSession = NXOpen.Session.GetSession()
file_name = theSession.LogFile.FileName

and yes, it could be somewhere else, depending on the NX environment when you start. The logfile location is defined by the environment variable UGII_TMP_DIR if I am not mistaken. If you use some startup script to set that it could be different between your run_journal and ugraf calls.

 

By "terminate on its own" you mean it threw an Exception? Then the logfile should still be there.

 

However, I'm on Linux NX11, if you run something different, your behaviour could be different.

Nikolas Losse | Developer | Siemens PG PR R&D TEC
NX12 | CentOS7 | Python

Re: No system log output when running from NX cmd with run_journal

Creator
Creator
That worked, it did end up in a different location. I didn't use a start up script, just the command prompt in the NX 11.0 folder. But I think the display launch may have some specific variables that could be different.