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

Disable logging to file in Settings #1705

Open
drws opened this issue May 1, 2023 · 10 comments · May be fixed by #1965
Open

Disable logging to file in Settings #1705

drws opened this issue May 1, 2023 · 10 comments · May be fixed by #1965
Labels
good first issue Simple change to start learning code base help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function

Comments

@drws
Copy link

drws commented May 1, 2023

The problem

Vorta currently logs to a dedicated file. Sometimes that might not be the preferred solution.

Requested Solution

An option to switch logging output to user''s journald.

Alternatives

None that I know of.

@drws drws added the type:enhancement Improvement of an existing function label May 1, 2023
@real-yfprojects
Copy link
Collaborator

I think supporting all kinds of logging services might be to much effort. I would be better to provide some kind of interface that easily allows to extend Vorta with different log consumers. Then you could implement a custom consumer that passes the logs to journald.

None that I know of.

Is there no way to include arbitrary log files in journald?

@m3nu
Copy link
Contributor

m3nu commented May 20, 2023

If you run Vorta via Systemd, the logs (console output) will be in Journald. That's totally doable and you can monitor or manage the process. Very common with e.g. Borgmatic.

You can't "import" random files.

@drws drws changed the title FR: Log to journald FR: Redirect log to journald --user May 22, 2023
@drws
Copy link
Author

drws commented May 22, 2023

@m3nu

If you run Vorta via Systemd, the logs (console output) will be in Journald.

Yes, but it will additionally also write into ~/.local/state/Vorta/log/vorta.log and ~/.cache/Vorta/log/vorta.log, which I'd like to avoid. The issue is about redirecting the log output somewhere else.

@real-yfprojects

I think supporting all kinds of logging services might be to much effort.

I know systemd/journald has its own quirks, but I wouldn't count the most widespread journalling daemon (journald), backward-compatible with previously most-spread one (syslog), as all kinds of logging services. The state of the fact is that Vorta doesn't support any logging daemon.

I would be better to provide some kind of interface that easily allows to extend Vorta with different log consumers.

While it would've been great to have a standardized interface, that is not Vorta's task to solve. The scope of this issue is to support only the most standardized one available - journald. Additionally, I'm a bit late to emphasize that we are talking about journald --user, which not all logging daemons even support.

However, there's an option to use a third-party library for the task (that supported as many daemons as possible). I think I saw something like that in the past, but it seems I haven't bookmarked it.

Then you could implement a custom consumer that passes the logs to journald.

That's two feature requests ahead, but of course it would also be good to have that feature.

Is there no way to include arbitrary log files in journald?

The too-lightly-emphasized point is that I don't want arbitrary hardcoded log files just lying around /home, so this is unfortunately not a solution. For example, journald supports system-wide logging to RAM with a single configuration line (to spare /home write cycles).

And also: I'm running pleothra of software and basically everything else already behaves and logs with journald/journald --user, Vorta really is sticking out.

@m3nu
Copy link
Contributor

m3nu commented May 22, 2023

As a multi-platform app we use the lowest common denominator, which are simple files.

I don't see us adding different logging frameworks, since it's mostly used for debugging right now. But there could be a setting to disable logging to files (default: enabled). Then you can capture them via Systemd only, if you really want.

@m3nu m3nu removed the type:enhancement Improvement of an existing function label May 22, 2023
@drws
Copy link
Author

drws commented May 22, 2023

Ok, fair enough. Disabling log files is still a solution. However:

  • Does Vorta echo all output that is also present in both log files?
  • This FR remains open. Do we repurpose it or open a new one?
  • What about an additional/auxiliary .service file? There is some talk in Google Summer of Code 2023 Student Questions #1583, but I can't seem to find related FRs/issues.

@m3nu m3nu changed the title FR: Redirect log to journald --user Disable logging to file in Settings May 25, 2023
@m3nu m3nu added type:enhancement Improvement of an existing function good first issue Simple change to start learning code base help wanted This issue is available, comment if you want to fix it labels May 25, 2023
@m3nu
Copy link
Contributor

m3nu commented May 25, 2023

Yes, console out put and log files are the same from the same Python logging source.

If you come up with a suitable .service file, we can add it to the docs under the Linux install instructions.

@AdwaitSalankar
Copy link
Contributor

AdwaitSalankar commented Feb 22, 2024

Screenshot from 2024-02-22 23-31-45(1)

Hi @m3nu, does this look good?

@drws
Copy link
Author

drws commented Feb 25, 2024

The inverted-logic approach is needlessly confusing. Please make it a simple "Enable logging to file" and ticked/checked by default.

@shivansh02
Copy link
Collaborator

@AdwaitSalankar are you working on this?

@AdwaitSalankar
Copy link
Contributor

@shivansh02 Yes, I am close to opening a PR.

@AdwaitSalankar AdwaitSalankar linked a pull request Mar 12, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Simple change to start learning code base help wanted This issue is available, comment if you want to fix it type:enhancement Improvement of an existing function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants