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
Member

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
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 26, 2023
@FabianLars FabianLars added platform: macos macOS specific issues plugin: log platform: linux Linux specific issues labels Apr 23, 2024
lucasfernog pushed a commit that referenced this issue Aug 2, 2024
* init geolocation plugin

* ios impl (w/o js api)

* generate ts api

* use newer tauri commit

* add temporary postinstall

* include src in files

* guest-js

* just ship dist-js for now

* fix watcher

* fix android compile error

* fix android build for real

* fix heading type

* initial getCurrentPosition android impl (wip)

* prevent panics if errors (strings) are sent over the channel

* Add android watchPosition implementation

* init haptics plugin (android)

* ios and new apis (ANDROID IS LIKELY BROKEN - MAY NOT EVEN COMPILE)

* use tauri-specta that accounts for raw fn arg idents

* add complete android support (it's not working great due to random soft-/hardware support)

* fix(haptics): Fix the NotificationFeedbackType::Success and Version (#1)

* Fix success feedback and version

* Apply suggestions from code review

* Update package.json

---------

Co-authored-by: Fabian-Lars <[email protected]>

* android: improve permission callback handling

* keep track of ongoing perms requests

* rebuild

* license headers

* rm sqlite feat

* fmt

* what diff u talkin bout?

* ignore dist-js again

* fix audits

* dedupe api.js

* clippy

* changefiles

* readmes

* clean up todos

* rm dsstore

* rm wrong feats

* mirror

* covector

* rebuild

* ios requires the wry feature

* lint

* update lock

---------

Co-authored-by: fabianlars <[email protected]>
Co-authored-by: Brendan Allan <[email protected]>
Co-authored-by: Naman Garg <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Sir-Thom referenced this issue in Sir-Thom/plugins-workspace Oct 22, 2024
* init geolocation plugin

* ios impl (w/o js api)

* generate ts api

* use newer tauri commit

* add temporary postinstall

* include src in files

* guest-js

* just ship dist-js for now

* fix watcher

* fix android compile error

* fix android build for real

* fix heading type

* initial getCurrentPosition android impl (wip)

* prevent panics if errors (strings) are sent over the channel

* Add android watchPosition implementation

* init haptics plugin (android)

* ios and new apis (ANDROID IS LIKELY BROKEN - MAY NOT EVEN COMPILE)

* use tauri-specta that accounts for raw fn arg idents

* add complete android support (it's not working great due to random soft-/hardware support)

* fix(haptics): Fix the NotificationFeedbackType::Success and Version (#1)

* Fix success feedback and version

* Apply suggestions from code review

* Update package.json

---------

Co-authored-by: Fabian-Lars <[email protected]>

* android: improve permission callback handling

* keep track of ongoing perms requests

* rebuild

* license headers

* rm sqlite feat

* fmt

* what diff u talkin bout?

* ignore dist-js again

* fix audits

* dedupe api.js

* clippy

* changefiles

* readmes

* clean up todos

* rm dsstore

* rm wrong feats

* mirror

* covector

* rebuild

* ios requires the wry feature

* lint

* update lock

---------

Co-authored-by: fabianlars <[email protected]>
Co-authored-by: Brendan Allan <[email protected]>
Co-authored-by: Naman Garg <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
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