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

Output per-file status info to systemd/syslog #64

Open
mpellegrin opened this issue Sep 3, 2020 · 1 comment
Open

Output per-file status info to systemd/syslog #64

mpellegrin opened this issue Sep 3, 2020 · 1 comment

Comments

@mpellegrin
Copy link

Hello,

Is there a way to query, with a pipe, an event, or a status file that would indicate if there are file being synchronized, how many, and eventually which one ?

Having an error log would also be pretty convenient to monitor failures.

I run the program with Systemd, so there may be a way to activate the debug mode, but I do not want to flood my syslog, and I would like precise insight on what the program is actually doing in real-time.

I could also write part of a patch myself, but it has been a long time since I didn't wrote a Java program, do you have any hint on how to achieve such functionality (in which class the file queue is handled, for instance) ?

@stephenh
Copy link
Owner

stephenh commented Sep 3, 2020

indicate if there are file being synchronized, how many, and eventually which one

Well, file paths are output to stdout as they are sent/received:

2020-09-03 09:12:07 INFO  Sending ...file path...

Granted, you don't have any insight into queued paths with that.

The mirror client commands accepts --debug-all and --debug-prefixes commands that will output more debug-ish-level information to stdout that might be the insight you're looking for. But it's still just written to stdout.

Otherwise, no, there is not like a debug/query API that allows interactive/programmatic interrogation of the current state of things.

Having an error log would also be pretty convenient to monitor failures.

It's been long enough that I forgot if errors are written to stdout or stderr, so you could check on that, but in theory that I think stdout/stderr are generally the unix-y way of doing what you're trying to do?

If you really want to start poking at internals, this would be a good starting place of "every so often, look at the queues and see what is going on":

https://github.com/stephenh/mirror/blob/master/src/main/java/mirror/QueueWatcher.java

Currently it only outputs information if it detects queues not draining fast enough, but you could tweak that.

@stephenh stephenh changed the title Status file / Log queue ? Output per-file status info to systemd/syslog Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants