FileNotFoundException: ./logs/log.txt

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

log4j:ERROR setFile(null,true) call failed. ./logs/log.txt (No such file or directory)
	at Method)
	at org.apache.log4j.FileAppender.setFile(
	at org.apache.log4j.RollingFileAppender.setFile(
	at org.apache.log4j.FileAppender.activateOptions(
	at org.apache.log4j.config.PropertySetter.activate(
	at org.apache.log4j.config.PropertySetter.setProperties(
	at org.apache.log4j.config.PropertySetter.setProperties(
	at org.apache.log4j.PropertyConfigurator.parseAppender(
	at org.apache.log4j.PropertyConfigurator.parseCategory(
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(
	at org.apache.log4j.PropertyConfigurator.doConfigure(
	at org.apache.log4j.PropertyConfigurator.doConfigure(
	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(
	at org.apache.log4j.LogManager.<clinit>(
	at org.apache.log4j.Logger.getLogger(
	at imagestudio.ImageStudioApp.<clinit>(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.exe4j.runtime.LauncherEngine.launch(
	at com.install4j.runtime.launcher.MacLauncher.main(

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



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"
    setopt Multi_OS

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

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.