FileNotFoundException: ./logs/log.txt

I just found the following error message in my Android Studio logs:

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ./logs/log.txt (No such file or directory)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
	at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
	at org.apache.log4j.Logger.getLogger(Logger.java:117)
	at imagestudio.ImageStudioApp.<clinit>(ImageStudioApp.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
	at com.install4j.runtime.launcher.MacLauncher.main(MacLauncher.java:53

It seem the installation missing the logs directors. My helpful installation fix script looks like this now:

#!/bin/zsh

APPIUM_HOME=…

setopt Err_Exit;
setopt XTrace;

if test "${USER}" = "root"; then
    pushd "${APPIUM_HOME}"
	chmod +x "bin/adb/js/zipalign"
	chmod +x "bin/adb/adb"
	chmod +x "bin/adbi/apt/aapt_64_mac"

	mkdir "logs"
	chmod a+w "logs"
    popd
else
    setopt Multi_OS

    sudo ${0:a} 1>&1 2>&2 &>~/Library/Logs/${0:r:t}.out
fi

So at what point do you edit this file to avoid the above error ?

Appium Studio expects an writeable logs directory inside its working directory. That would be /Applications/AppiumStudio/logs for most (but not all) installations.

Needing an writeable directory within /Applications on macOS is very much against Apples programming guide lines and I suggest to update log4j configuration for macOS to use ~/Library/Logs instead.

Which reminds me: Both ~/appiumstudio and ~/appiumstudio-reports are also violations of the macOS programming guide lines. You should store data in ~/Library/Preferences/AppiumStudio ~/Library/Application Support/AppiumStudio and ~/Library/Logs/AppiumStudio instead.

And give me the change to configure where I keep my workspaces instead of use hardcoding ~/workspace/appium-project.

Cluttering the users home directory is so 1990. We don’t do that any more.