Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[log] Default log path for linux and windows seems unconventional #1

Closed
ozgunozerk opened this issue May 13, 2022 · 4 comments
Closed
Labels
good first issue Good for newcomers platform: linux Linux specific issues platform: macos macOS specific issues plugin: log status: upstream This issue needs to be fixed in an upstream project

Comments

@ozgunozerk
Copy link

ozgunozerk commented May 13, 2022

I believe the convention for storing the log files on Linux is, using the path /var/log.
Is there a specific reason for choosing .config instead? (https://github.com/tauri-apps/tauri-plugin-log/blob/dev/src/lib.rs#L106)

@JonasKruckenberg
Copy link
Contributor

Referencing the original PR: tauri-apps/tauri#2736 this was done to mirror the behavior of electrons setAppLogsPath function.

The reason for this is that most packaging formats (snap, appimage, flatpack) reserve an Application Directory for you, that in many cases is the only folder that is writable by default.
${configDir}/${bundleIdentifier} (despite the misleading name of configDir) happens to resolve to exactly that folder ($XDG_CONFIG_HOME or $HOME/.config is you were wondering).

So this really boils down to sandbox restrictions and we don't want peoples logging to fail because of missing sanbox privileges.

If you never plan on distributing snap, appimage or flatpack formats and only ever ship deb packages, or you manually request the necessary sandbox privilegess than you can use LogTarget::Dir("/var/log".into()) without a problem.

@FabianLars
Copy link
Member

FabianLars commented May 13, 2022

While following setAppLogsPath is fine by me, i too feel like the config dir is "wrong", on linux and windows btw.
That said i don't like /var/log/ for desktop apps at all and the alternative seems to be ~.local/share/ and AppData\Local (instead of AppData\Roaming -> data_local_dir()

On the other hand i'm not a fan of splitting up app files into multiple dirs, but that's just personal preference i guess.

@nazar-pc
Copy link

On Linux either ~/.local/share or even .cache would be more canonical. /var/log is not for regular GUI apps as it is not writable for most users.

Can someone link to upstream info/issues on sandboxing? If they don't support something as simple as proper place for logs instead of config directory, then we should create corresponding tickets for them to add such support.

@FabianLars FabianLars added the good first issue Good for newcomers label May 26, 2022
@JonasKruckenberg JonasKruckenberg transferred this issue from tauri-apps/tauri-plugin-log Dec 14, 2022
@FabianLars FabianLars changed the title Default log path for linux seems unconventional [log] Default log path for linux seems unconventional Dec 14, 2022
Beanow pushed a commit that referenced this issue Jan 7, 2023
feat: Add example with an `emit_all` event
@FabianLars FabianLars changed the title [log] Default log path for linux seems unconventional [log] Default log path for linux and windows seems unconventional Apr 27, 2023
@FabianLars
Copy link
Member

/upstream tauri-apps/tauri

@tauri-apps tauri-apps bot added the status: upstream This issue needs to be fixed in an upstream project label Apr 27, 2023
@FabianLars FabianLars added platform: macos macOS specific issues plugin: log platform: linux Linux specific issues labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers platform: linux Linux specific issues platform: macos macOS specific issues plugin: log status: upstream This issue needs to be fixed in an upstream project
Projects
Status: 📬Proposal
Development

No branches or pull requests

4 participants