Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); In-development patch notes for Starsector 0.98a (2/8/25)

Author Topic: startsector.log location on Mac OS  (Read 5082 times)

hqz

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
startsector.log location on Mac OS
« on: March 20, 2016, 04:00:41 AM »

I can't find the starsector.log file anywhere on Mac OS. Is there something specific to do to enable the log file?
Logged

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Re: startsector.log location on Mac OS
« Reply #1 on: March 20, 2016, 09:26:09 AM »

I've had all kinds of issues with the log not being made on Mac. It's supposed to be in the logs folder within Starsector.app but never is. The best solution I've found is to run Starsector through the terminal, which causes the log to be printed to the terminal window. Just go to Starsector.app/Contents/MacOS/starsector_mac.sh and copy-paste its path into terminal.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25054
    • View Profile
Re: startsector.log location on Mac OS
« Reply #2 on: March 20, 2016, 09:30:58 AM »

Yeah, it doesn't generate the log file on a mac. Been meaning to look into this for a long time now; it appears to be an issue with the logging package I'm using. The terminal workaround is the best way to go for the moment.
Logged

hqz

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: startsector.log location on Mac OS
« Reply #3 on: March 20, 2016, 09:58:36 AM »

Thanks for the quick reply.

I've been using the terminal approach so far as well. I was about to mess with log4j.properties but I thought I would ask first in case it's just something I missed.

So far I've found this:
Code
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=${com.fs.starfarer.settings.paths.logs}/starsector.log

A quick look at System.getProperties() returned the following:
Code
user.dir=/Applications/Starsector.app/Contents/Resources/Java
com.fs.starfarer.settings.paths.logs=../../../logs

Which should resolve to /Applications/Starsector.app/logs in theory.

So it seems like it should work as far as log4j.properties is concerned.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25054
    • View Profile
Re: startsector.log location on Mac OS
« Reply #4 on: March 20, 2016, 10:02:17 AM »

It's the same log4j.properties file that gets used on Windows/Linux, too, and it works there. I'd suspect it's some kind of "no permissions to create file inside app package" issue except the game is able to create save files without a problem, so that's probably not it either. Hmm.
Logged

hqz

  • Lieutenant
  • **
  • Posts: 73
    • View Profile
Re: startsector.log location on Mac OS
« Reply #5 on: March 21, 2016, 02:43:06 AM »

Just to confirm, I tried with -Dcom.fs.starfarer.settings.paths.logs=/tmp/ in Contents/MacOS/starsector_mac.sh and it didn't create the log file either.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25054
    • View Profile
Re: startsector.log location on Mac OS
« Reply #6 on: March 21, 2016, 09:56:48 AM »

Thanks, good to know. An annoying bug, that one.
Logged

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Re: startsector.log location on Mac OS
« Reply #7 on: March 24, 2016, 06:47:04 AM »

I've found that logs work if you run the game directly out of Starsector's Java folder (this requires having all folders such as mods, logs, and saves, in said folder.) it's possible to get the log files to generate properly.
Logged

pigreko

  • Commander
  • ***
  • Posts: 138
    • View Profile
Re: startsector.log location on Mac OS
« Reply #8 on: March 24, 2016, 07:46:30 AM »

wait, how do you do that? I mean, how do you run SS from the java folder?
Logged

isaacssv552

  • Commander
  • ***
  • Posts: 215
    • View Profile
Re: startsector.log location on Mac OS
« Reply #9 on: March 26, 2016, 08:35:14 PM »

wait, how do you do that? I mean, how do you run SS from the java folder?
Starsector.app/Contents/Resources/Java/starsector.command will run out of the Java folder, you can even use mods if you put your mods folder in the Java folder.
Logged