Closed ghost closed 2 years ago
By default logging is disabled, I can help you enable it but I think something else is going on. The MuWire settings directory is in ${XDG_CONFIG_HOME}/MuWire
. Inside that folder there will be several files and folders, one of which is called directories
. It should contain one file ending in .json
for each folder that is shared.
But first, did the folder you added have any files in it? If it didn't, MuWire will not process it. Try adding a folder with some files in it by clicking the Share
button or by dragging-and-dropping the folder onto the library. If that doesn't work I'll show you how to turn on logging and we can investigate further.
There are many json
files in directories
so I guess it's processing it. Please tell me how to enable logging as I can't see any sign that the task is executing in the UI.
Ok, enabling logging is a bit complicated, especially on the AUR package. Anyway, this is how you can do it:
logging.properties
MuWire.log
to /path/to/log/directory/MuWire.log
com.muwire.core.files.level = FINE
com.muwire.core.files.directories.level = FINE
/usr/bin/muwire
or muwire.sh
based on the AUR package descriptor-DdisableUpdates='true' \
add a line -Djava.util.logging.config.file=/home/<username>/logging.properties \
MuWire.log
should appear in the path you configured in step 2 above.Let me know if that works.
There is no file /home/user/.config/MuWire/MuWire.log
. This are the files after the changes:
/home/user/logging.properties
/usr/bin/muwire
Can I place logging.properties
in /home/user/.config/MuWire/logging.properties
?
And can I use $HOME
in logging.properties
in this line? java.util.logging.FileHandler.pattern = /home/user/.config/MuWire/MuWire.log
?
The logging.properties
file looks correct and the changes to /usr/bin/muwire
look correct too. You can place the logging.properties
file anywhere you wish as long as in the start script you reference it with -Djava.util.logging.config.file=/path/logging.properties
. However you cannot use environment variables inside the logging.properties
file itself, it needs to contain absolute paths.
Can you check if MuWire.log
appeared in your home directory? Another thing you can try is to launch MuWire from a terminal and see if it prints out anything on stdout or stderr.
I'm going to ask the AUR package maintainer to take a look too. @dbermond can you think of any reason why the logging configuration isn't working?
I need to go afk for a few hours as it's getting late here but I'll check on this issue later.
I hadn't saved the file /usr/bin/muwire
. Now I see MuWire.log
. What are the available log levels and how can I change it?
There are several, MuWire uses only SEVERE
, WARNING
, INFO
and FINE
.
If it's processing the shared folders and files there should be entries in MuWire.log
already. Are there any?
@zlatinb It looks like the OP solved the issue, as he has not saved the file.
It's not a good idea to modify /usr/bin/muwire
, as this file is tracked by pacman and thus it will be overwritten at each package upgrade. So the user will lose the modification after upgrading the package. As a general rule, files shipped by the package should not modified due to this reason.
Instead, the needed java options can be simply specified at command line when in need to enable logging:
JDK_JAVA_OPTIONS+='-Djava.util.logging.config.file=/path/to/logging.properties' muwire
This works fine for me and MuWire.log
is correctly generated at the location specified by the pointed logging.properties
.
If you want the logging option to be permanent without the need to specify it at command line every time, you should create a custom script, place it in your PATH
and execute it instead of the one shipped by the package.
Yes, the files appear in the log.
What other things can be logged besides com.muwire.core.files.level
and com.muwire.core.files.directories.level
? In case I need it at another time.
The logging levels can be specified per package or class level. There are many packages that contain many classes in MuWire, so it really depends on what kind of functionality you want to troubleshoot. You would need to look in the code for the package and class names (under core/src/main/groovy
) or ask me.
To set the "global" level for all packages, edit the line that looks like
.level = ...
I recommend you keep the global level at SEVERE
or WARNING
otherwise you will get too much information and possibly even slow MuWire down.
I've tried adding a folder to MuWire but it hasn't added it, I want to take a look at the logs to see if it's working on the task or has failed. Where can I find the logs?
I'm using this in my environment
So I've taken a look at
~/.cache/MuWire
but there isn't anything.