Patreon Logo Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal Logo PayPal. You can also buy games using our partner links for GOG and Humble Store.
Title: Is there a way to change the output location of proton log?
ExpandingMan 16 Feb 2023
Something that bugs me is that it's now *very* hard to know whether problems in a game are linux-specific, or if they are just problems with the game. These days things are good enough that it seems like (at least on my system) if something runs, it's probably not going to be much different than running it on windows. However, occasionally a game crashes, and I just don't know.

I would *really* like to always output logs, but steam wants to put them in `$HOME` which drives me bananas. Does anyone know if there is a way to change the location where it outputs the logs?
whizse 16 Feb 2023
User Avatar
Set PROTON_LOG_DIR to your preferred directory.

It's documented here:
https://github.com/ValveSoftware/Proton#runtime-config-options
ExpandingMan 16 Feb 2023
Thanks! I feel a bit silly, I knew about this list but somehow I remembered having looked for this before and failed to find it.
Grogan 16 Feb 2023
User Avatar
Just so you know you're not alone, abuse of $HOME drives me bananas also. My home directory is for software configurations. (I don't even store anything there... and Steam is mounted off elsewhere with symlinks in ~/.steam pointing to the correct location).

(Though I don't enable PROTON_LOG often enough to have thought about that though, generally only for one run, and generally to log a startup crash at that, then I take out the variable. Those can get pretty huge if running a noisy game for any length of time (e.g. 100M once with a Borderlands 3 log I generated lol)

But now that you mention it, I think I'm going to add that to my user_settings.py template so my builds always have that PROTON_LOG_DIR var. Then if I forget to remove it from games' launch options it's just going to be on my big "scratch" partition on mechanical storage... that's where I do all my building and staging and stuff, I'm not chewing up flash cells.
ExpandingMan 17 Feb 2023
Yeah, developers being totally unfamiliar with linux and having games stash files in ridiculous places (such as the games own directory directly in `$HOME`) is very annoying. This is part of why I think the best advice for developers who do not feel comfortable supporting linux is "just do windows but try to use vulkan". As much as I'd like to see true native linux games, depressingly few developers do a good job supporting it.

By the way, where is the best place to set the environment for steam? I guess `.profile` is the only real option.

I'll probably only turn this on for games that sometimes crash, but it would be nice not to have to set `PROTON_LOG_DIR` every time.

Last edited by ExpandingMan on 17 Feb 2023 at 3:08 pm UTC
whizse 17 Feb 2023
User Avatar
Quoting: ExpandingManBy the way, where is the best place to set the environment for steam? I guess `.profile` is the only real option.

I'll probably only turn this on for games that sometimes crash, but it would be nice not to have to set `PROTON_LOG_DIR` every time.
The usual way is probably in user_settings.py, but you would have to set it for every Proton version you have.

I usually just stick stuff like that in the launch options for a game if needed.

Not sure if .profile is sourced for the GUI sessions or just a login shell. I guess it depends on your distribution?
ExpandingMan 17 Feb 2023
Well that's annoying: when I set `PROTON_LOG_DIR` in `user_settings.py` doesn't output *ANY* logs anywhere. `PROTON_LOG_DIR` from the game launch command seems to work ok.
whizse 17 Feb 2023
User Avatar
Quoting: ExpandingManWell that's annoying: when I set `PROTON_LOG_DIR` in `user_settings.py` doesn't output *ANY* logs anywhere. `PROTON_LOG_DIR` from the game launch command seems to work ok.
Not sure what's up with that. Syntax error in the file? Does setting other options without touching PROTON_LOG_DIR work?
Grogan 17 Feb 2023
User Avatar
All of those settings in user_settings.py are variables that can be overridden. Proton is supposed to run that to set defaults though.

It should be just

PROTON_LOG_DIR="/path/to/dir"

Edit: Wrong (see subsequent posts)... it's

"PROTON_LOG_DIR": "/path/to/dir",

and don't miss the comma

On a line by itself in user_settings.py

You could just export that variable globally, for example somewhere in /etc/profile.d

export PROTON_LOG_DIR="/path/to/dir"

P.S. ~/.profile or /etc/profile or scripts in /etc/profile.d are supposed to apply to ALL shells, login or not. If a distro doesn't do that, then it's broken and in need of a slap.

Last edited by Grogan on 18 Feb 2023 at 12:46 am UTC
whizse 17 Feb 2023
User Avatar
Quoting: GroganPROTON_LOG_DIR="/path/to/dir"

On a line by itself in user_settings.py
No. It's a Python script.

Something like this (inside the user_settings dict):

"PROTON_LOG_DIR": "/path/to/dir",
Grogan 17 Feb 2023
User Avatar
Ahh, right... I wasn't looking at the file when I said that, it's just the end result from the environment where it's name = value

That's likely what he did wrong, or possibly missed the comma (because it does work in the file... I added it last night lol)
Grogan 18 Feb 2023
User Avatar
I just tested this to be sure, it does work globally for me if I add

export PROTON_LOG_DIR="/path/to/dir"

To one of the files in /etc/profile.d (I just stuck it in the file I use to set variables for mesa)

I first commented out my line in user_settings.py and logged right off my user and back.

Now, I hadn't thought of this earlier either, but I log in to the shell first and use "startx", I don't use graphical login managers. I guess where this "depends on the distro" is if you use some graphical login manager and the distributor hasn't set it up to source /etc/profile (which itself should source the parts in /etc/profile.d)

If I had some silly distro ignoring my shell environment, I'd probably add "source /etc/profile" to the init script or unit that starts the login manager :-)
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon Logo Patreon. Plain Donations: PayPal Logo PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register